首先vue路由要设置成hash
const router = new VueRouter({
mode: 'hash',
base: process.env.BASE_URL,
routes
})
然后再vue.config.js配置
module.exports = {
publicPath:'./',
}
直接输入网址
localhost:port/dist/index.html
首先vue路由要设置成hash
const router = new VueRouter({
mode: 'hash',
base: process.env.BASE_URL,
routes
})
然后再vue.config.js配置
module.exports = {
publicPath:'./',
}
直接输入网址
localhost:port/dist/index.html