我需要通过目标事件updateTags
方法。这是下面的组合框:
当我打电话给comboActive
方法我可以获得目标事件。
KeyboardEvent {isTrusted: true, key: "y", code: "KeyY", location: 0, ctrlKey: false, …}
请注意,comboActive
组合框中的方法不发送任何参数,但在方法中comboActive(event)
我可以获取目标事件。
我希望能够在其中获取目标事件updateTags
方法。正如你所看到的,我尝试过使用$event
但这不起作用
HTML:
<v-combobox multiple
v-model="select[i]"
append-icon
small-chips
deletable-chips
@keyup="comboActive"
@paste="updateTags(item,i)"
@change="updateTags(item,i,$event)">
</v-combobox>
SCRIPT:
comboActive(event) {
console.log('active ', event)
event.target.parentElement.classList.add('saving')
},
updateTags(item, i, e) {
this.$nextTick(() => {
this.$nextTick(() => {
console.log('complete ', item, e)
})
})
},
当我添加$event
the @change="updateTags(item,i,$event)"
我拿回了一系列物品。我需要组合框本身,以便我可以删除在comboActive
method.