1
In a filter where fields are filled in there is the need sometimes to clear the field.
I’m trying to clear a field and recognize the value of that action by clicking on the "x" to clear the form
Only nothing happens at all.
Like I’m doing?
<v-menu ref="menu" v-model="menu" :close-on-content-click="false" transition="scale-transition" offset-y max-width="290px" min-width="auto" >
<template v-slot:activator="{ on, attrs }">
<v-text-field ref="mes" v-model="descMes" label="Mês" append-icon="mdi-calendar" v-bind="attrs"v-on="on" clearable autofocus dense outlined @click.clear="clear('mes')" />
</template>
<v-date-picker v-model="mes" no-title @input="menu = false" type="month" @click:month="parametroCliente" locale="pt-BR" />
</v-menu>
I mean, I put the attribute @click.clear="clear('mes')"
Where there is a function called clear(param)
in the methods
But this only works if I click inside the field, if I click the 'x' of to trigger the clearable
the field is clean but the function is not triggered
I also tried using @Blur to leave the field identify if it is empty
All this is for a filter that I would like to do, where if it has no value, it is to search every month
Is there any way to trigger some action by clicking on the 'X' option'?
face here works but I use the click on 'X' like : @click:clear="clear('mes')" test then see if it is the syntax really
– Germano Buss Niehues
That’s right, oh!
– adventistaam
I’ll answer the question
– Germano Buss Niehues