#v-date-picker In custom modules

3 messages · Page 1 of 1 (latest)

zinc flint
#

Has anyone had any luck using v-date-picker in custom modules?

When I try and listen to the emits it always returns null and the close is never called.

quick EX

      <v-menu ref="dateTimeMenu" :close-on-content-click="false" attached :disabled="false" full-height seamless>
        <template #activator="{ toggle, active }">
          <v-input
              :active="active"
              :model-value="this.dateNow"
              clickable
              readonly
              @click="toggle"
          >
          </v-input>
        </template>
        <v-date-picker
            :model-value="this.dateNow"
            v-on:update:model-value="setVal"
            v-on:close="log('Closed')"
        />
      </v-menu>

mortal kilnBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

zinc flint
#

To follow up here I found the issue.
the type attr does not have a default and needs to be specified on the date picker

            <v-date-picker
                :type="'date'"
                :model-value.sync="this.pickedDate"
                @update:model-value="setVal"
                @close="updateDate"
            />

after adding the type the emit's were being sent as expected