From 3c4fee1db116c11d4f04727cfe076d7c94daeaf2 Mon Sep 17 00:00:00 2001 From: yanzhaofeige <yanzhaofeige@qq.com> Date: Mon, 30 Sep 2024 12:10:57 +0800 Subject: [PATCH] init --- cpzidc-ui/src/layout/components/IframeToggle/index.vue | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/cpzidc-ui/src/layout/components/IframeToggle/index.vue b/cpzidc-ui/src/layout/components/IframeToggle/index.vue new file mode 100644 index 0000000..39ad15b --- /dev/null +++ b/cpzidc-ui/src/layout/components/IframeToggle/index.vue @@ -0,0 +1,33 @@ +<template> + <transition-group name="fade-transform" mode="out-in"> + <inner-link + v-for="(item, index) in iframeViews" + :key="item.path" + :iframeId="'iframe' + index" + v-show="$route.path === item.path" + :src="iframeUrl(item.meta.link, item.query)" + ></inner-link> + </transition-group> +</template> + +<script> +import InnerLink from "../InnerLink/index"; + +export default { + components: { InnerLink }, + computed: { + iframeViews() { + return this.$store.state.tagsView.iframeViews; + } + }, + methods: { + iframeUrl(url, query) { + if (Object.keys(query).length > 0) { + let params = Object.keys(query).map((key) => key + "=" + query[key]).join("&"); + return url + "?" + params; + } + return url; + } + } +} +</script> -- Gitblit v1.9.3