重写DOM原型方法你觉得呢?
var desc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')
Object.defineProperty(HTMLInputElement.prototype, 'value', {
...desc,
set(v) {
console.log('set',v);
desc.set.call(this, v)
}
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…