<template> <view class="page-web"> <web-view ref='webview' :webview-styles="webviewStyles" :src="src"></web-view> </view> </template> <script> export default { name: "WEB", data() { return { // src:'http://192.168.0.38:8081/index.html#/middle?type=mieye&', src:null, webviewStyles: { progress: { color: '#FF4050' } }, timer:null, titleVal:'', urlWeb:'', typePage:false, deviceStatus:'', viewerUrl:'/hybrid/html/web/viewer.html' } }, onLoad(options){ const that=this // console.log(options,'options') that.src=decodeURIComponent(options.src) let pages = getCurrentPages(); let page = pages[pages.length - 1]; let currentWebView = page.$getAppWebview(); // // #ifdef APP-PLUS // var wv = plus.webview.create('', 'custom-webview', { // plusrequire: 'none', //禁止远程网页使用plus的API // 'uni-app': 'none', //不加载uni-app渲染层框架,避免样式冲突 // top: uni.getSystemInfoSync().statusBarHeight + 44 //放置在titleNView下方。 // }); // wv.loadURL(options);//加载url // let pages = getCurrentPages();//获取当前页面栈的实例 // let currentPage = pages[pages.length - 1]; // 上一页 // var currentWebview = currentPage.$getAppWebview();//获取当前页面的webview对象实例 // currentWebview.append(wv);//Webview窗口中添加子窗口 // // #endif }, methods: { }, onShow(){ console.log("websrc 的webview") } } </script> <style lang="less" scoped> .page-web { width: 100vw; height: 100vh; web-view { width: 100%; height: 100%; } } </style>