|
@@ -1,7 +1,9 @@
|
|
|
-import { useDialog } from 'naive-ui';
|
|
|
-import { defineComponent } from 'vue';
|
|
|
+import { NButton, NModal, NSpace, useDialog } from 'naive-ui';
|
|
|
+import { defineComponent, ref } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-
|
|
|
+import downBg from './images/downBg.png'
|
|
|
+import rocketIcon from './images/rocketIcon.png'
|
|
|
+import styles from './index.module.less'
|
|
|
export default defineComponent({
|
|
|
name: 'router-error',
|
|
|
setup() {
|
|
@@ -9,7 +11,7 @@ export default defineComponent({
|
|
|
const dialog = useDialog();
|
|
|
let isOpen = false;
|
|
|
|
|
|
-
|
|
|
+ const showModalMask = ref(false)
|
|
|
|
|
|
|
|
|
router.onError((error, to, form) => {
|
|
@@ -27,7 +29,7 @@ export default defineComponent({
|
|
|
negativeText: '取消',
|
|
|
onPositiveClick: () => {
|
|
|
router.push(to)
|
|
|
- window.location.reload();
|
|
|
+ showModalMask.value = true
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -50,7 +52,7 @@ export default defineComponent({
|
|
|
positiveText: '确定',
|
|
|
negativeText: '取消',
|
|
|
onPositiveClick: () => {
|
|
|
- window.location.reload();
|
|
|
+ showModalMask.value = true
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -64,12 +66,38 @@ export default defineComponent({
|
|
|
return;
|
|
|
}
|
|
|
refreshing = true;
|
|
|
- window.location.reload();
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
checkNewVersion()
|
|
|
- return () => <div></div>;
|
|
|
+
|
|
|
+ const reloadPage = ()=>{
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ return () => <div>
|
|
|
+ <NModal v-model:show={showModalMask.value} mask-closable={false}>
|
|
|
+ <div class={styles.downMove}>
|
|
|
+ <img src={rocketIcon} class={styles.dingPng} alt="" />
|
|
|
+ <img src={downBg} class={styles.downMoveBg} alt="" />
|
|
|
+ <h2>发现新版本</h2>
|
|
|
+ <p>
|
|
|
+ 为提升您的用户体验,请刷新页面后使用
|
|
|
+ </p>
|
|
|
+ {/* <NButton>确定</NButton> */}
|
|
|
+ <NSpace style={{ padding: '25px 0 0 0' }} justify="center">
|
|
|
+ <NButton
|
|
|
+
|
|
|
+ class={styles.submitAppBtn}
|
|
|
+ round
|
|
|
+ type="primary" onClick={reloadPage}>
|
|
|
+ 立即刷新
|
|
|
+ </NButton>
|
|
|
+ </NSpace>
|
|
|
+ </div>
|
|
|
+ </NModal>
|
|
|
+
|
|
|
+ </div>;
|
|
|
}
|
|
|
});
|