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
}
Thanks
Francis
Update 1: Since version 2.3. 0 v-form has disabled property, it sets to true it disables all children inputs. They haven't implemented such a thing to disable all children of a `v-form` yet. You should bind `disabled` prop to `false` for every control.
The v-text directive is a Vue. js directive used to update a element's textContent with our data. It is just a nice alternative to Mustache syntax. First, we will create a div element with id as app and let's apply the v-text directive to this element with data as a message.
The v-app component is the root of your application and a direct replacement for the default Vue entrypoint, <div id="app"> . The v-main component is a semantic replacement for the main HTML element and the root of your application's content.
You can use the @click:clear="()"
so you can clear your text at the same time it will call the function.
Here's the example
https://codepen.io/anon/pen/ePmLOg?editors=1010
Use the clear-icon-cb
prop. This allows you to use a custom callback function when the clear icon when clicked.
<v-text-field
clearable
:clear-icon-cb="onClearClicked">
</v-text-field>
onClearClicked () {
// do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With