Vue.directive("percision", {
unbind(el) {
console.log(el)
console.log('解绑了')
const input = el.querySelector('.el-input__inner') || el.querySelector('.el-textarea__inner') || el;
input.removeEventListener('compositionstart', el.start)
input.removeEventListener('compositionend', el.end)
},
bind(el, binding, vnode) {
console.log(el)
console.log('绑定了')
const input = el.querySelector('.el-input__inner') || el.querySelector('.el-textarea__inner') || el;
el.start = () => {
vnode.locking = true
}
el.end = () => {
vnode.locking = false
input.dispatchEvent(new Event('input'))
set