解决报错 We‘re sorry but doesn‘t work properly without JavaScript enabled. Please enable it to continue.

前言

vue项目打包发布到线上之后报错 doesn't work properly without javascript enabled. Please enable it to continue.
修改router模式之后重新打包上传就可以了。

一、修改router模式

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  {
    path: '/home',
    name: 'Home',
    ***ponent: () => import('@/views/home/index.vue')
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router

修改方法

 把history改成hash即可

转载请说明出处内容投诉
CSS教程_站长资源网 » 解决报错 We‘re sorry but doesn‘t work properly without JavaScript enabled. Please enable it to continue.

发表评论

欢迎 访客 发表评论

一个令你着迷的主题!

查看演示 官网购买