diff --git a/src/components/DiyEditor/index.vue b/src/components/DiyEditor/index.vue index 44cb10a7..1c0119fb 100644 --- a/src/components/DiyEditor/index.vue +++ b/src/components/DiyEditor/index.vue @@ -102,8 +102,8 @@ @@ -306,9 +306,12 @@ const handleDeleteComponent = (index: number) => { // 工具栏操作 const emits = defineEmits(['reset', 'preview', 'save', 'update:modelValue']) + +// 注入无感刷新页面函数 +const reload = inject<() => void>('reload') // 重置 const handleReset = () => { - message.warning('开发中~') + if (reload) reload() emits('reset') } // 预览 diff --git a/src/layout/components/AppView.vue b/src/layout/components/AppView.vue index ffdf11f5..44341873 100644 --- a/src/layout/components/AppView.vue +++ b/src/layout/components/AppView.vue @@ -20,6 +20,17 @@ const getCaches = computed((): string[] => { }) const tagsView = computed(() => appStore.getTagsView) + +//region 无感刷新 +const routerAlive = ref(true) +// 无感刷新,防止出现页面闪烁白屏 +const reload = () => { + routerAlive.value = false + nextTick(() => (routerAlive.value = true)) +} +// 为组件后代提供刷新方法 +provide('reload', reload) +//endregion