@@ -24,6 +24,12 @@
* 2021.2.1
*/
export default {
+ props: {
+ permission: {
+ type: Number,
+ default: 0
+ }
+ },
data() {
return {
// 当前路由地址
@@ -68,8 +74,13 @@
rolToTabBars: [],
}
},
+ watch: {
+ permission(newVal) {
+ this.getRolToTabBars(newVal)
created(){
- this.getRolToTabBars();
+ this.getRolToTabBars(uni.getStorageSync('nowPermission'));
methods: {
// 路由跳转
@@ -80,8 +91,7 @@
});
// 获取权限对应的地步导航
- getRolToTabBars() {
- const permission = uni.getStorageSync('nowPermission');
+ getRolToTabBars(permission) {
if(!permission) {
this.rolToTabBars = [];
}else {