Skip to content

Commit

Permalink
fix(button): 修改button文档、avatar条件判断
Browse files Browse the repository at this point in the history
  • Loading branch information
cos2004 committed Sep 28, 2018
1 parent 1d6811d commit 1b8128c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions docs/markdown/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ import { AtButton } from 'taro-ui'
```
:::

## 带Icon
## 带 loading icon

:::demo
```html
<AtButton icon='clock' type='primary' size='normal'>按钮文案</AtButton>
<AtButton loading type='primary'>按钮文案</AtButton>
```
:::
Expand All @@ -48,7 +47,6 @@ import { AtButton } from 'taro-ui'
|:-----|:---|:---------|:-----------------------------|:--------|:-----------------------|:---------|
||| type | 按钮的类型 | String | `primary`, `secondary` | - |
||| size | 按钮的大小 | String | `normal`, `small` | `normal` |
||| icon | 按钮的图标名字 | String | 见文档 `Icon 图标` | - |
||| circle | 设置按钮圆角 | Boolean | - | false |
||| loading | 设置按钮的载入状态 | Boolean | - | false |
||| disabled | 设置按钮为禁用态(不可点击) | Boolean | - | false |
Expand Down
2 changes: 1 addition & 1 deletion src/components/avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class AtAvatar extends AtComponent {
if (text) letter = text[0]

let elem
if (openData.type === 'userAvatarUrl' && Taro.getEnv() === Taro.ENV_TYPE.WEAPP) {
if (openData && openData.type === 'userAvatarUrl' && Taro.getEnv() === Taro.ENV_TYPE.WEAPP) {
elem = (<OpenData type={openData.type}></OpenData>)
} else if (image) {
elem = (<Image className='at-avatar__img' src={image} />)
Expand Down

0 comments on commit 1b8128c

Please sign in to comment.