vue参照iframe単純実装
810 ワード
コンポーネント
css iframe の の
js
css iframe の の
js
export default {
name: "task",
data() {
return {
}
},
methods: {
getUrl() {
this.$refs.iframe.contentWindow.location.replace("https://www.baidu.com/")
}
},
mounted() {
this.getUrl();
}
}
~~~