x-essential-lib 0.10.16 → 0.10.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -822,34 +822,6 @@ function useMicroApp(globalStates, base, customBack) {
|
|
|
822
822
|
syncStatusBar();
|
|
823
823
|
}, { immediate: true });
|
|
824
824
|
}
|
|
825
|
-
async function handleBack() {
|
|
826
|
-
if (!isEmpty(views)) {
|
|
827
|
-
if (!hasView(views, "waitDlg")) popView(views);
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
const routeMeta = matchRouteMeta(route.path);
|
|
831
|
-
if (!routeMeta) return;
|
|
832
|
-
if (routeMeta.level === 0) navigator?.Backbutton?.goHome(() => {}, () => {});
|
|
833
|
-
else if (customBack) customBack(routeMeta);
|
|
834
|
-
else if (routeMeta.back) await router.replace({
|
|
835
|
-
path: routeMeta.back,
|
|
836
|
-
query: { orgId: activeOrg.value }
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
async function onKeyDown(e) {
|
|
840
|
-
if (e.key === "Escape") {
|
|
841
|
-
await handleBack();
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
if (base) {
|
|
846
|
-
onMounted(() => {
|
|
847
|
-
window.addEventListener("keydown", onKeyDown);
|
|
848
|
-
});
|
|
849
|
-
onBeforeUnmount(() => {
|
|
850
|
-
window.removeEventListener("keydown", onKeyDown);
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
825
|
let handle;
|
|
854
826
|
async function syncPermission() {
|
|
855
827
|
if (!running.value) return;
|
|
@@ -884,6 +856,34 @@ function useMicroApp(globalStates, base, customBack) {
|
|
|
884
856
|
stopTimer();
|
|
885
857
|
});
|
|
886
858
|
}
|
|
859
|
+
async function handleBack() {
|
|
860
|
+
if (!isEmpty(views)) {
|
|
861
|
+
if (!hasView(views, "waitDlg")) popView(views);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
const routeMeta = matchRouteMeta(route.path);
|
|
865
|
+
if (!routeMeta) return;
|
|
866
|
+
if (routeMeta.level === 0) navigator?.Backbutton?.goHome(() => {}, () => {});
|
|
867
|
+
else if (customBack) customBack(routeMeta);
|
|
868
|
+
else if (routeMeta.back) await router.replace({
|
|
869
|
+
path: routeMeta.back,
|
|
870
|
+
query: { orgId: activeOrg.value }
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
async function onKeyDown(e) {
|
|
874
|
+
if (e.key === "Escape") {
|
|
875
|
+
await handleBack();
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
if (!base) {
|
|
880
|
+
onMounted(() => {
|
|
881
|
+
window.addEventListener("keydown", onKeyDown);
|
|
882
|
+
});
|
|
883
|
+
onBeforeUnmount(() => {
|
|
884
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
887
|
function onUpdateDark(val) {
|
|
888
888
|
dark.value = val;
|
|
889
889
|
}
|