laravel无法正确识别Vue

时间:2020-02-17 22:44:17

标签: laravel vue.js

一段时间以来,我在laravel中遇到了有关vue的问题。基本上,当我尝试转到window.Vue = require ('vue');时,进入我的app.js文件 给我这个错误:

Type 'typeof import ("myFolder)' is missing the following properties from type 'typeof Vue': prototype, extend, nextTick, set, and 10 more.ts (2740).

如果我反而上去 Vue.component ('example-component', require ('./ components / ExampleComponent.vue'). Default); 它告诉我Vue 'refers to a UMD global, but the current file is a module. Consider adding an import instead.ts (2686). Visual Studio快速修复建议我输入这个

 import Vue from 'vue / types / umd';

但是这样做不再能与我的js建立连接 然后控制台通过启动npm run watch

释放此错误
ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve 'vue / types / umd' in 'C: \ Users \ rispo \ OneDrive \ Desktop \ Final Project \ BoolBnb \ resources \ js'
 @ ./resources/js/app.js 1: 0-32 24: 0-3 36: 14-17
 @ multi ./resources/js/app.js ./resources/sass/app.scss.

我已经尝试从终端安装vue,但是该问题无法以任何方式解决。你有什么建议吗?

0 个答案:

没有答案