forked from qianguyihao/Web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d97313
commit 5d8bf5c
Showing
4 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
### 001、对象的赋值 | ||
|
||
(1)在 store 中定义一个对象: | ||
|
||
```javascript | ||
userInfo: { | ||
pin: '', | ||
nickName: '', | ||
avatarUrl: DEFAULT_AVATAR, | ||
definePin: '', | ||
isbind: true | ||
}, | ||
``` | ||
|
||
(2)从接口拿到数据后,给这个对象赋值: | ||
|
||
```javascript | ||
this.userInfo = { | ||
...this.userInfo, | ||
pin: res.base.curPin, | ||
nickName: res.base.nickname, | ||
avatarUrl: res.base.headImageUrl ? res.base.headImageUrl : DEFAULT_AVATAR, | ||
definePin: res.definePin | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters