提交 | 用户 | 时间
|
e57a89
|
1 |
<template> |
懒 |
2 |
<transition-group name="fade-transform" mode="out-in"> |
|
3 |
<inner-link |
|
4 |
v-for="(item, index) in iframeViews" |
|
5 |
:key="item.path" |
|
6 |
:iframeId="'iframe' + index" |
|
7 |
v-show="$route.path === item.path" |
|
8 |
:src="iframeUrl(item.meta.link, item.query)" |
|
9 |
></inner-link> |
|
10 |
</transition-group> |
|
11 |
</template> |
|
12 |
|
|
13 |
<script> |
|
14 |
import InnerLink from "../InnerLink/index"; |
|
15 |
|
|
16 |
export default { |
|
17 |
components: { InnerLink }, |
|
18 |
computed: { |
|
19 |
iframeViews() { |
|
20 |
return this.$store.state.tagsView.iframeViews; |
|
21 |
} |
|
22 |
}, |
|
23 |
methods: { |
|
24 |
iframeUrl(url, query) { |
|
25 |
if (Object.keys(query).length > 0) { |
|
26 |
let params = Object.keys(query).map((key) => key + "=" + query[key]).join("&"); |
|
27 |
return url + "?" + params; |
|
28 |
} |
|
29 |
return url; |
|
30 |
} |
|
31 |
} |
|
32 |
} |
|
33 |
</script> |