vue contenteditable处理火狐浏览器复制带标签问题
this.$refs.materialTxt.addEventListener('paste', function(e) { console.log('监听到了') e.stopPropagation() e.preventDefault() let text = ''; const event = (e.originalEvent || e) if (event.clipboardData && event.clipboardData.getData) { text = event.clipboardData.getData('text/plain') } else if (window.clipboardData && window.clipboardData.getData) { text = window.clipboardData.getData('Text') } if (document.queryCommandSupported('insertText')) { document.execCommand('insertText', false, text) } else { document.execCommand('paste', false, text) } })