This commit is contained in:
qianguyihao
2019-06-14 11:35:23 +08:00
parent 3d97313732
commit 5d8bf5c079
4 changed files with 61 additions and 5 deletions

View File

@@ -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
}
```