lengziyu / noteBook

This is my noteBook.
0 stars 0 forks source link

最近遇到的问题记录 #27

Open lengziyu opened 5 years ago

lengziyu commented 5 years ago

1.vue路由开启mode: 'history'模式时,跳转刷新Cannot GET /

vue开启路由mode: 'history'模式

  return new Router({
    mode: 'history',
})

跳转点击刷新出现:Cannot GET /about,解决方法是在vue.config.js(vue-cli3)配置添加:

module.exports = {
  devServer: {
    historyApiFallback: true
  },
}

服务器端设置的话用nginx解决。

lengziyu commented 5 years ago

2.vue-cli3注释eslint

vue.config.js配置添加:

module.exports = {
   lintOnSave: false,
}