主要就是捕获事件,阻止传播。
在对应的标签上添加@copy.native.capture.prevent='handCopy'
@copy.native.capture.prevent='handCopy'
在对应的标签上添加@paste.native.capture.prevent='handPaste'
@paste.native.capture.prevent='handPaste'
Fun:
handPaste () { console.log('禁止粘贴') return false}
两行代码解决你的问题 浏览器兼容性很好 你值得拥有!