0

I have a filter that uses a date picker component, when I reload the page or refresh my table, the filter defaults always to the same date, and the filter is applied with that date. How can I make the date default to blank? I already set the value to "null" but it doesn´t work.

  <v-menu
    v-if="f.type === 'datepicker' && index < 6 * k && index >= 6 * (k - 1)"
    v-model="f.menu"
    :close-on-content-click="false"
    transition="scale-transition"
    offset-y
    min-width="auto"
  >
    <template v-slot:activator="{ on, attrs }">
      <v-text-field
        v-model="f.value"
        :label="f.label"
        readonly
        clearable
        dense
        v-bind="attrs"
        :rules="f.rule"
        outlined
        :required="f.required"
        class="mx-3"
        v-on="on"
      />
    </template>
    <v-date-picker
      v-model="f.value"
      color="primary"
      no-title
      :range="f.range"
      scrollable
    >
      <v-spacer />
      <v-btn text color="primary" @click="f.menu = false"> Okey </v-btn>
    </v-date-picker>
  </v-menu>

in data I have this field filter control

fieldsFilterControl: [
  {
    type: "datepicker",
    label: "RANGO DE FECHAS",
    value: null,
    range: true,
    menu: false,
  }
],

Always return the same date when reload

enter image description here

Yue JIN
  • 1,047
  • 1
  • 10
  • 20
acrisvall
  • 25
  • 8
  • You could use any kind of persistent solution to make that one work: https://stackoverflow.com/a/66872372/8816585 Write on change and read upon page reload (or component mounting process mainly). – kissu Oct 20 '22 at 23:41
  • Hi, why did you deleted your question here? https://stackoverflow.com/questions/74391008/open-pdf-link-in-new-browser-tab-js-vue?noredirect=1#comment131328754_74391008 – kissu Nov 10 '22 at 17:48
  • I realized that my question wasn´t well defined; the function I quoted was working fine, but the feature I need has to be made from by backend – acrisvall Nov 10 '22 at 19:53

0 Answers0