Vue router keep iframe dom element (just hide, don't destroy)

白昼怎懂夜的黑 提交于 2019-12-06 07:46:31

You will need to use a v-show on your iframe. On route, you will not specify the component

<template>
    <iframe v-show="$route.path == '/foo'">
</template>

<script>
routes: [
        { path: '/foo'},
        { path: '/bar' }
    ]
</script>

p.s... i'm looking for a more elegant way to do that... should be a property on router to tell that we want to hide, not destructed/recreated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!