⚡优化内链iframe没有传递参数
This commit is contained in:
parent
fb517dd799
commit
e1879c706c
@ -5,7 +5,8 @@
|
|||||||
:key="item.path"
|
:key="item.path"
|
||||||
:iframeId="'iframe' + index"
|
:iframeId="'iframe' + index"
|
||||||
v-show="route.path === item.path"
|
v-show="route.path === item.path"
|
||||||
:src="item.meta.link"></inner-link>
|
:src="iframeUrl(item.meta.link, item.query)">
|
||||||
|
</inner-link>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -15,4 +16,14 @@ import useTagsViewStore from '@/store/modules/tagsView'
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const tagsViewStore = useTagsViewStore()
|
const tagsViewStore = useTagsViewStore()
|
||||||
|
|
||||||
|
function 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>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user