Javascript window.Vue.use不是一个函数
我正在运行Javascript window.Vue.use不是一个函数,javascript,php,laravel,vue.js,Javascript,Php,Laravel,Vue.js,我正在运行Laravel6.20.24,LaravelMixV6.0.18,NPM7.11.2,NodeV15.14.0,WSL2Ubuntu20.04.1LTS,vue:“^2.6.12”, 在文件中:resources\assets\js\laravel\customer\index.js 我有这个密码 require("../bootstrap"); window.Vue = require("vue"); Vue.component( &
Laravel6.20.24
,LaravelMixV6.0.18
,NPM7.11.2
,NodeV15.14.0
,WSL2Ubuntu20.04.1LTS
,vue:“^2.6.12”,
在文件中:resources\assets\js\laravel\customer\index.js
我有这个密码
require("../bootstrap");
window.Vue = require("vue");
Vue.component(
"intro-component",
require("./components/IntroComponent.vue").default
);
在:resources\views\customer\welcome.blade.php
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Sample</title>
<meta name="csrf-token" content="{{ csrf_token() }}">
</head>
<body>
<div id="app">
<intro-component
:roles="{{ $roles }}"
:industries="{{ json_encode($industries) }}"
:legal_roles="{{ $legal_roles }}"
redirect-after-save="{{ $setting_url }}">
</intro-component>
</div>
</body>
<script src="{{ mix('js/customer/index.js') }}"></script>
</html>
它说window.Vue.use不是编译文件上的函数
这有什么问题?问题出在index.js(主文件)中。
文件应该是这样的
import Vue from 'vue'
import App from './App'
import Vuex from 'vuex'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(Vuex)
Vue.use(BootstrapVue)
Vue.use(BootstrapVueIcons)
new Vue({
router,
store
render: h => h(App)
}).$mount('#app')
import Vue from 'vue'
import App from './App'
import Vuex from 'vuex'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(Vuex)
Vue.use(BootstrapVue)
Vue.use(BootstrapVueIcons)
new Vue({
router,
store
render: h => h(App)
}).$mount('#app')