Vuetify - 清除 v 文本字段时如何触发方法 [英] Vuetify - How to trigger method when clear a v-text-field
本文介绍了Vuetify - 清除 v 文本字段时如何触发方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在使用 Vuetify 清除文本字段时调用方法?
is there a way to call a method while clearing a text-field with Vuetify?
<v-text-field
class="mt-2 mb-0"
clearable
solo
v-model="searchQuery"
append-icon="search"
@click:append-outer="searchCos"
label="Nom de compagnies ou mots-clés">
</v-text-field>
...
onClear() {
doSomethingHere
}
谢谢
弗朗西斯
推荐答案
你可以使用 @click:clear="()"
这样你就可以在它调用的同时清除你的文本功能.
You can use the @click:clear="()"
so you can clear your text at the same time it will call the function.
示例如下
https://codepen.io/anon/pen/ePmLOg?editors=1010
这篇关于Vuetify - 清除 v 文本字段时如何触发方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文