Error when trying to use vuetify components inside the menu
linspw opened this issue · comments
Example:
<template>
<context-menu>
<template
#itemRender="{
disabled,
label,
icon,
showRightArrow,
onClick,
onMouseEnter,
keyBoardFocusMenu,
showSubMenu,
}"
>
<div
:class="[
'mx-context-menu-item',
disabled ? ' disabled' : '',
keyBoardFocusMenu ? 'keyboard-focus' : '',
showSubMenu ? 'open' : '',
]"
@click="onClick"
@mouseenter="onMouseEnter"
>
<v-img
src="https://imengyu.top/assets/images/test/icon.png"
style="width: 20px; height: 20px"
/>
<i
v-if="icon"
:class="`${icon} v-icon notranslate v-theme--light v-icon--size-small d-flex mr-4`"
/>
<div
v-else
class="v-icon notranslate v-theme--light v-icon--size-small d-flex mr-4"
/>
<span v-if="label" class="flex-grow-1">{{ label }}</span>
<span v-if="showRightArrow" class="right-arraw">
<i
:class="`fas fa-caret-right v-icon notranslate v-theme--light v-icon--size-small d-flex ml-4`"
/>
</span>
</div>
</template>
<slot />
</context-menu>
</template>
<script setup lang="ts"></script>
defaults.ts:28 Uncaught (in promise) Error: [Vuetify] Could not find defaults instance
at injectDefaults (defaults.ts:28:24)
at setup (defineComponent.tsx:109:24)
at callWithErrorHandling (chunk-CVEDGHOZ.js:186:18)
at setupStatefulComponent (chunk-CVEDGHOZ.js:6203:25)
at setupComponent (chunk-CVEDGHOZ.js:6164:36)
at mountComponent (chunk-CVEDGHOZ.js:4801:7)
at processComponent (chunk-CVEDGHOZ.js:4767:9)
at patch (chunk-CVEDGHOZ.js:4240:11)
at mountChildren (chunk-CVEDGHOZ.js:4484:7)
at mountElement (chunk-CVEDGHOZ.js:4391:7)
Thank you for your question! It has been fixed in version 1.2.7
Thank you very much the behavior was adjusted, it was excellent!