0👍
@dayclick="onDayClick"
attempts to register an event listener on the <input>
for an event named "dayclick"
, but there’s no such event for HTMLInputElement
.
It looks like you’re really trying to listen to VCalendar
‘s dayclick
event, so the event listener should be on <v-date-picker>
instead of <input>
:
<!--
<v-date-picker>
<template>
<input @dayclick="onDayClick">
^^^^^^^^^^^^^^^^^^^^^^ ❌
-->
<v-date-picker @dayclick="onDayClick">
<template>
<input>
Your dayclick
handler could emit the selected date to the parent component with $emit
:
export default {
methods: {
onDayClick(date) {
this.$emit("date-selected", date); 👈
},
},
};
- [Vuejs]-How to save the ids from one form in one page to another intermediate table
- [Vuejs]-Vue 2 + Webpack common imports work for one app but fail for another
Source:stackexchange.com