作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 Laravel 项目中开发 VueJS 3,我正在使用一个 JS 文件,该文件为我提供了用于 Markdown 工具栏的元素。基本上,它是一组功能,为我提供了应用所选 Markdown 选项的按钮。一切正常,但我得到了我希望它们消失的那些控制台错误。
它们都类似于这个:
Failed to resolve component: md-linedivider
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
at <Markdowntoolbar>
at <Article onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > >
at <BaseTransition mode="out-in" appear=false persisted=false ... >
at <Transition enter-active-class="animate__animated animate__fadeInLeft" leave-active-class="animate__animated animate__bounceOutUp" mode="out-in" >
at <RouterView>
at <App>
at <Bodycomponent>
at <App>
最佳答案
在你的 webpack.mix.js 中试试这个
mix.js('resources/assets/js/app.js', 'public/js').vue({
options: {
compilerOptions: {
isCustomElement: (tag) => ['md-linedivider'].includes(tag),
},
},
});
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => ['md-linedivider'].includes(tag),
}
}
})
]
})
关于javascript - 如何在 Laravel 项目中为 VueJS 3 设置 compilerOptions.isCustomElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71601714/
我正在尝试让一个 webcomponent 与 vitejs 一起工作。 我正在尝试使用的组件: https://www.webcomponents.org/element/input-knob 我按
我正在 Laravel 项目中开发 VueJS 3,我正在使用一个 JS 文件,该文件为我提供了用于 Markdown 工具栏的元素。基本上,它是一组功能,为我提供了应用所选 Markdown 选项的
我是一名优秀的程序员,十分优秀!