Я пытаюсь использовать компоненты vuetify в моем собственном плагине vue, который я создал, но кажется, что рендеринг моего плагина до того, как приложение "узнает", что vuetify существует.
Я пытался использовать Vue.use (Vuetify) внутри моего плагина, но он не работал, и в принципе нет смысла использовать его в моем плагине, так как я хочу, чтобы пользователь (разработчик) плагина использовал vuetify как глобальная зависимость в его приложении, так что он может просочиться до моего плагина
это мой vu html шаблон плагина:
<v-content>
<v-container fluid fill-height>
<v-layout justify-center>
<div v-if="videoLoading">
<v-progress-circular v-if="useVuetifyLoader"
:size="size"
:width="width"
:rotate="rotate"
:value="videoLoadingProgress*1.5"
:color="color"
>
Downloading...
{{ `${loadedInMB}/${totalInMb}Mb` }}
</v-progress-circular>
<div v-else>
Downloading...
{{ `${loadedInMB}/${totalInMb}Mb` }}
</div>
</div>
<div v-else>
<div>
<div>foo</div>
</div>
</div>
</v-layout>
</v-container>
</v-content>
и это мой плагин:
import MyPlugin from '../lib/MyPlugin.vue';
import Vuetify from 'vuetify'
const install = function (Vue, config) {
Vue.component("my-plugin", MyPlugin)
}
export { install }
*and i tried also :*
import MyPlugin from '../lib/MyPlugin.vue';
import Vuetify from 'vuetify'
const install = function (Vue, config) {
Vue.use(Vuetify)// <-- did not work
Vue.component("my-plugin", MyPlugin)
}
export { install }
и когда я внедряю свой плагин в другое приложение, я получаю следующие ошибки:
Unknown custom element: <v-content> - did you register the component correctly? For recursive components, make sure to provide the "name" option
Unknown custom element: <v-container> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
Unknown custom element: <v-layout> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
Unknown custom element: <v-progress-circular> - did you register the component correctly? For recursive components, make sure to provide the "name" option.