一、vue使用路由跳转后,页面不置顶
配置路由index.js时,增加
export default new Router({
scrollBehavior(to,from,saveTop){
if(saveTop){
return saveTop;
}else{
return {x:0,y:0}
}
},
routes:[...]
})
二、vue项目上线后,页面提示在360浏览器中样式显示不正确
1、强制使用IE浏览器最高版本,默认用极速内核
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
2、页面提示“Vuex requires a Promise polyfill in this browser”错误
安装babel-polyfill插件
npm install babel-polyfill --save-g
在main.js中引入插件
import 'babel-polyfill'
三、vue页面刷新后提示cannot get
取消index.js配置里的mode:'history'
export default new Router({
//mode:'history',
routes: [...]
})