84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
<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)