1.router类型不能设置为history
const router = new Router({
mode: '',
routes,
});
//避免打包到django后刷新报错
2.样式放static里面,适配django
3.在根目录新建vue.config.js
module.exports = {
assetsDir:'./static/static/',
}
更多配置可参考:https://cli.vuejs.org/zh/config/#publicpath
4.退出参考
window.location.href = './account/logout/'