1.router类型不能设置为history

const router = new Router({
  mode: '',
  routes,
});
//避免打包到django后刷新报错

2.样式放static里面,适配django

3.在根目录新建vue.config.js

module.exports = {
  assetsDir:'./static/static/', #这个是生成样式存放的路径
 
publicPath:'', #这个才是链接前缀 '' ='./'
}

更多配置可参考:https://cli.vuejs.org/zh/config/#publicpath

4.退出参考

window.location.href = './account/logout/'

 

posted on 2019-05-10 17:34  聪神carry  阅读(314)  评论(0)    收藏  举报