<td contenteditable="true" @input="inputEvent()"></td>
You need to pass in the td dom element in inputEvent();
td
inputEvent()
https://vuejs.org/v2/guide/ev...
Why do we need to pass it? Isn’t it in the event object?
<body> <p id="app"> <button @click='add'>按钮</button> </p> </body>
new Vue({ el: "#app", methods: { add(e) { console.log(e.target) } } })
Is this what you mean? ?
If there are no parameters, just set an event in the receiving method function (event) {} If there are other parameters, use inputEvent($event,other)
// 传一个event @input="inputEvent($event)" inputEvent(e) { console.log(e.path[0]. outerHTML) }
https://vuejs.org/v2/guide/ev...
Why do we need to pass it? Isn’t it in the event object?
Is this what you mean? ?
If there are no parameters, just set an event in the receiving method
function (event) {}
If there are other parameters, use inputEvent($event,other)