#项目是Vue3.0 用的vue-cli4.5
#以下是main.js
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
const app = createApp(App);
app.use(ElementPlus).use(store).use(router).mount('#app')
#控制台报如下错误
ERROR Failed to compile with 1 error 下午9:52:45
error in ./node_modules/async-validator/dist-web/index.js
Module parse failed: Unexpected token (847:18)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| class Schema {
| // ========================= Static =========================
> static register = function register(type, validator) {
| if (typeof validator !== 'function') {
| throw new Error('Cannot register a validator by type, validator is not a function');
@ ./node_modules/element-plus/es/components/form/index.js 6:0-45 453:28-42
@ ./node_modules/element-plus/es/components/index.js
@ ./node_modules/element-plus/es/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.228:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js