ios端会出现拷贝和粘贴,请问怎么禁用掉复制和查询的功能呢?
- 发布:2020-10-19 15:50
- 更新:2020-11-04 09:58
- 阅读:1000
如图web-view组件引入本地html后,长按web-view区域,会出现复制和查询功能,怎么去掉?
StarSky (作者) - 前端工程师
解决了,不是是web-view的问题,忘记给本地html禁用复制拷贝功能了
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
onReady() {
// #ifdef APP-PLUS
var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview()
setTimeout(function() {
wv = currentWebview.children()[0];
wv.setStyle({top:150,height:300})
wv.setStyle({
top:150 + 'px',
height:300 + 'px',
'-webkit-touch-callout':'none',
'-webkit-user-select':'none',
'-khtml-user-select':'none',
'-moz-user-select':'none',
'-ms-user-select':'none',
'user-select':'none',
})
}, 400); //如果是页面初始化调用时,需要延时一下
// #endif
},
帮忙看一下吧,“-webkit-touch-callout:none”带不带引号我都试过了,要是有啥错误帮忙指以下,自己可能眼瞎确实没注意到,谢谢