首页 > 其他分享 >nuiapp在APP中的.nvue页面中使用webview展示空白的问题

nuiapp在APP中的.nvue页面中使用webview展示空白的问题

时间:2022-09-28 10:22:59浏览次数:56  
标签:nvue nuiapp APP height 问题 空白 ifdef webview

之前写的一个uniapp的项目,这段时间又看了一下,在打包的APP中发现webview打开显示空白(以前的时候没问题)

一开始以为是链接问题,跨域问题,总之就是各种尝试了

因为小程序上没问题,一开始没想到从webview的高度上出发

最后果然是高度问题(EMO~~~~)

最后给style设置动态高度:

<web-view ref="webview" :style="viewStyle" allow :fullscreen="true" :webview-styles="webviewStyles" :src="UrlLink" @onPostMessage="handleMessage" @message="handleMessage"></web-view>
onReady() {
            let _this = this;
            
            // #ifdef APP-PLUS || MP-WEIXIN
                uni.getSystemInfo({
                    success: function (res) {
                        _this.viewStyle.height =    res.windowHeight;
                    }
                });
            // #endif
            
            // #ifdef H5
                this.viewStyle.height =    window.screen.height - 44 + "px";
            // #endif
}

 

 

标签:nvue,nuiapp,APP,height,问题,空白,ifdef,webview
From: https://www.cnblogs.com/zyfenblog/p/16737075.html

相关文章