我尝试使用vue-datepicker(https://vue3datepicker.com/installation/),但没有成功。首先,我在\plugins目录下创建了一个类:('\plugins\vue-datepicker.js')
import Datepicker from '@vuepic/vue-datepicker';
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.vueApp.use(Datepicker)
})
然后我尝试在我的应用程序中使用
<Datepicker />
但我犯了个错误
runtime-core.esm-bundler.js:38 [Vue warn]: Failed to resolve component: DatePicker
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
1条答案
按热度按时间dluptydi1#
我不知道是否正确,但它为我工作
plugins/vuedatepicker.js
index.uve
或本地
nuxt.config.ts
参考:https://vue3datepicker.com/installation/#nuxt
index.vue