首先在store中定义所需要的变量可以进行初始化,再定义一个方法,登录成功后A页面,跳转到B页面之前,需要直接调用store中存储数据的方法,全局可以使用

诸如以上所示,该问题,百度了好久,多亏群里大佬。vue使用less报错的解决方法 安装less less-loader
vue使用less报错的解决方法 安装less less-loader
cnpm install less less-loader --save-dev
cnpm install less less-loader --save-devapp.vue是所有XXX.vue文件的根文件
所以webapp,的底部通常是在这里配置h5的新增
标题

主题内容

固定的底部内容

所以底部通常不使用footerh5的新增元素在最底部水平排列
元素在最底部水平排列

外卖

搜索

订单

我的



.myfooterbox {
width: 100%;
display: flex;
justify-content: space-between;
position: fixed;
bottom: 0;
left: 0;
}



外卖

搜索

订单

我的



.myfooterbox {
width: 100%;
display: flex;
justify-content: space-between;
position: fixed;
bottom: 0;
left: 0;
}

ps==>如果元素的宽度是自身的宽度。
justify-content: space-between;可能是是没有效果的。点击路由跳转
点击路由跳转
this.$router.push({ path: "/search" });
this.$router.push({ path: "/search" });给当前点击的元素添加背景色 同样是借助三目运算 如果是true 添加某一个类给当前点击的元素添加背景色 同样是借助三目运算 如果是true 添加某一个类
.on {
background: pink;
}

外卖

搜索


.on {
background: pink;
}

外卖

搜索

路由跳转
路由跳转
外卖

搜所


methods: {
handlersell() {
this.$router.push({ path: "/" });
},
handlersearch() {
this.$router.push({ path: "/search" });
},
}


外卖

搜所


methods: {
handlersell() {
this.$router.push({ path: "/" });
},
handlersearch() {
this.$router.push({ path: "/search" });
},
}

优化后 使用了replace

外卖

搜索


handlergo(path) {
this.$router.replace(path);
}


外卖

搜索


handlergo(path) {
this.$router.replace(path);
}

以上就是本文的全部内容,希望对大家的学习有所帮助。