diff --git a/ruoyi-ui/src/layout/components/AppMain.vue b/ruoyi-ui/src/layout/components/AppMain.vue index a25c5625..66b33bf8 100644 --- a/ruoyi-ui/src/layout/components/AppMain.vue +++ b/ruoyi-ui/src/layout/components/AppMain.vue @@ -22,6 +22,22 @@ export default { key() { return this.$route.path } + }, + watch: { + $route() { + this.addIframe() + } + }, + mounted() { + this.addIframe() + }, + methods: { + addIframe() { + const {name} = this.$route + if (name && this.$route.meta.link) { + this.$store.dispatch('tagsView/addIframeView', this.$route) + } + } } } diff --git a/ruoyi-ui/src/layout/components/TagsView/index.vue b/ruoyi-ui/src/layout/components/TagsView/index.vue index 1fc23235..44eff7d4 100644 --- a/ruoyi-ui/src/layout/components/TagsView/index.vue +++ b/ruoyi-ui/src/layout/components/TagsView/index.vue @@ -133,11 +133,7 @@ export default { const { name } = this.$route if (name) { this.$store.dispatch('tagsView/addView', this.$route) - if (this.$route.meta.link) { - this.$store.dispatch('tagsView/addIframeView', this.$route) - } } - return false }, moveToCurrentTag() { const tags = this.$refs.tag