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