序文
vue プロジェクトがパッケージ化されてオンラインでリリースされると、エラーが報告され、 doesn't work properly without JavaScript enabled. Please enable it to continue.
ルーター モードが変更され、再パッケージ化されてアップロードされます。
1.ルーターモードを変更する
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{ path: '/', redirect: '/home' },
{
path: '/home',
name: 'Home',
component: () => import('@/views/home/index.vue')
},
]
const router = new VueRouter({
mode: 'hash',
base: process.env.BASE_URL,
routes
})
export default router
修正方法
履歴をハッシュに変更するだけです