我正在 Laravel 项目中开发 VueJS 3,并且正在使用一个 JS 文件,该文件为我提供了用于 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>
Run Code Online (Sandbox Code Playgroud)
这就是说,应通过compilerOptions.isCustomElement 将 md-linedivider 元素从组件解析中排除。我确实到处寻找解决方案,但只找到了这个,但我的 laravel 项目中没有 vue.config.js 来应用它。我尝试在 webpack.mis.js 和 app.js 中执行此操作,但没有成功。
有人有什么想法吗?
Taylor Otwell 宣布新的 Laravel 项目现在将与 Vite 一起运行,并且默认安装 Vite。我似乎无法运行开发环境npm run dev
我安装了新的 laravel 项目,安装了带有 SSR 的 Laravel JetStream,并且团队支持点击了“npm install 命令”。
每次我运行npm run dev
它都会显示:
如果我打开本地链接,它会显示以下内容:
为什么我无法使用npm run dev
和编译我的文件?
这是我全新的 Laravel 应用程序的 package.json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build && vite build --ssr"
},
"devDependencies": {
"@inertiajs/inertia": "^0.11.0",
"@inertiajs/inertia-vue3": "^0.6.0",
"@inertiajs/progress": "^0.2.7",
"@inertiajs/server": "^0.1.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/typography": "^0.5.2",
"@vitejs/plugin-vue": "^2.3.3",
"@vue/server-renderer": "^3.2.31",
"autoprefixer": "^10.4.7",
"axios": "^0.25",
"laravel-vite-plugin": "^0.2.1",
"lodash": "^4.17.19",
"postcss": "^8.4.14",
"tailwindcss": "^3.1.0", …
Run Code Online (Sandbox Code Playgroud)