I am copying an first example from the official documentation Vuetify about Menus, but the result is an error :
"Property or method "on" is not defined on the instance but referenced during render".
<template>
<v-app>
<div class="text-xs-center">
<v-menu offset-y>
<template v-slot:activator="{ on }">
<v-btn
color="primary"
dark
v-on="on"
>
Dropdown
</v-btn>
</template>
<v-list>
<v-list-tile
v-for="(item, index) in items"
:key="index"
@click=""
>
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
</v-list-tile>
</v-list>
</v-menu>
</div>
</v-app>
</template>
<script>
export default {
data: () => ({
items: [
{ title: 'Click Me' },
{ title: 'Click Me' },
{ title: 'Click Me' },
{ title: 'Click Me 2' }
]
})
}
</script>
To fix the '[Vue warn]: Property or method is not defined on the instance but referenced during render' error with Vue. js, we should make sure the reactive property we're referencing in the template is defined in the component code.
So what does v-slot:activator=”{ on }” mean ? The activator slot is expecting to receive props, so { on } is just extracting the on property from props, in other words props. on, where on refers to the scoped props passed to the template from the tooltip component.
Image Aspect Ratios in Vuetify Use the aspect-ratio prop of the v-img component to set a fixed aspect ratio. The ratio between the height and width stays the same when the image is resized.
Vuex is a state management pattern + library for Vue. js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.
In my case work but browser showed warning, adding on prop remove warning for me using vuetify 2.2.4
props: ['on']
Edit: My problem was that I was using v-on="on"
outside of template that was declaring with v-slot, remove it worked for me
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