mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 03:03:41 +00:00
perf: 优化UserAvatar组件
This commit is contained in:
parent
2e03cee726
commit
7a168977da
@ -103,7 +103,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["userId", "userInfo", "userOnline"]),
|
...mapState(["userId", "userInfo", "userOnline", "cacheUserBasic"]),
|
||||||
|
|
||||||
boxStyle() {
|
boxStyle() {
|
||||||
const style = {};
|
const style = {};
|
||||||
@ -198,6 +198,10 @@
|
|||||||
this.setUser(this.userInfo);
|
this.setUser(this.userInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const tempUser = this.cacheUserBasic.find(({userid}) => userid == this.userid);
|
||||||
|
if (tempUser) {
|
||||||
|
this.setUser(tempUser);
|
||||||
|
}
|
||||||
this.$store.dispatch("getUserBasic", {userid: this.userid});
|
this.$store.dispatch("getUserBasic", {userid: this.userid});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user