摘录原文链接
代码记录
<template>
<view>
<web-view :src="goToUrl()" progress></web-view>
</view>
</template>
<script>
var wv; //计划创建的webview
export default {
components: {},
data() {
return {
};
},
onLoad() {
},
onReady() {
// #ifdef APP-PLUS
var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
setTimeout(function() {
wv = currentWebview.children()[0]
wv.setStyle({
scalable: true
})
}, 1000); //如果是页面初始化调用时,需要延时一下
// #endif
},
methods: {
goToUrl()
}
}
</script>
<style lang="scss">
</style>