在美国服务器vue中引入组件的方式有以下两种
1.使用import方法导入组件
import Vue from ‘vue’
import router from ‘./router’
import App from ‘./App’
import ‘common/css/index.scss’;
2.使用require方法导入组件
const router = new Router({
router: [
{
path: “/”,
redirect: ‘/home’,
},
{
path: ‘/home’,
name: ‘/home’,
component:resolve => {
require([‘../views/home/home.vue’],resolve)
}
},