fix 修复 修复默认关闭Tags-Views时,内链页面打不开

This commit is contained in:
疯狂的狮子Li 2024-12-03 11:15:09 +08:00
parent b61865f45f
commit 00f7ab34ef
2 changed files with 15 additions and 4 deletions

View File

@ -20,6 +20,7 @@ import useTagsViewStore from '@/store/modules/tagsView';
import IframeToggle from './IframeToggle/index.vue'; import IframeToggle from './IframeToggle/index.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const tagsViewStore = useTagsViewStore(); const tagsViewStore = useTagsViewStore();
// //
@ -37,6 +38,20 @@ watch(
}, },
{ immediate: true } { immediate: true }
); );
onMounted(() => {
addIframe()
})
watch((route) => {
addIframe()
})
function addIframe() {
if (route.meta.link) {
useTagsViewStore().addIframeView(route)
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -135,11 +135,7 @@ const addTags = () => {
} }
if (name) { if (name) {
useTagsViewStore().addView(route as any); useTagsViewStore().addView(route as any);
if (route.meta.link) {
useTagsViewStore().addIframeView(route as any);
}
} }
return false;
}; };
const moveToCurrentTag = () => { const moveToCurrentTag = () => {
nextTick(() => { nextTick(() => {