小编Mos*_*aid的帖子

如何在 Laravel 项目中为 VueJS 3 设置compilerOptions.isCustomElement

我正在 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 中执行此操作,但没有成功。

有人有什么想法吗?

javascript compiler-errors laravel vue.js vuejs3

46
推荐指数
5
解决办法
12万
查看次数

自从 Laravel 用 Vite 更新后,我无法运行“npm run dev”

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)

compiler-errors laravel vite

19
推荐指数
4
解决办法
5万
查看次数

标签 统计

compiler-errors ×2

laravel ×2

javascript ×1

vite ×1

vue.js ×1

vuejs3 ×1