1.router类型不能设置为history
const router = new Router({
mode: '',
routes,
});
//避免打包到django后刷新报错
2.样式放static里面,适配django
3.在根目录新建vue.config.js
module.exports = {
assetsDir:'./static/static/', #这个是生成样式存放的路径
publicPath:'', #这个才是链接前缀 '' ='./'
}
4.退出参考
window.location.href = './account/logout/'