鍍金池/ 問答/HTML/ npm run bulid 打包后 index.html 頁面報錯

npm run bulid 打包后 index.html 頁面報錯

npm run bulid 輸出后 靜態(tài)頁面出現(xiàn)錯誤圖片描述

main.js代碼

import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import routes from './router'
Vue.use(VueRouter)
// Vue.config.productionTip = false
const router = new VueRouter({
  mode: 'history',//去掉#
  routes
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

router.js代碼

import Index from '@/views/index'
import Settled from '@/views/settled'
// const Index = () => import(/* webpackChunkName: "group-Index" */ '@/views/index');
// const Settled = () => import(/* webpackChunkName: "group-Settled" */ '@/views/settled');
let routes = [
  {
    path: '/',
    name: '首頁',
    component: Index
  },
  {
    path: '/settled',
    name: '商家入駐',
    component: Settled
  },
  {
    path: '*',
    hidden: true,
    redirect: { path: '/404' }
  }
]
export default routes;
回答
編輯回答
薔薇花

去挑router.js里面自定義路由字段就好了

2018年8月21日 12:50
編輯回答
淚染裳

組件之間是不是有相互調(diào)用導(dǎo)致死鎖的

2017年9月13日 13:14