Skip to content

Commit

Permalink
fix(component): 修复组件报参数类型错误的 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
koppthe committed Sep 28, 2018
1 parent 1b8128c commit 9760c2f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/components/tab-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class AtTabBar extends AtComponent {
onClick={this.handleClick.bind(this, i)}
>
{item.iconType ? (
<AtBadge dot={item.dot} value={item.text} max={item.max}>
<AtBadge dot={!!item.dot} value={item.text} max={item.max}>
<View className='at-tab-bar__icon'>
<AtIcon
prefixClass={item.iconPrefixClass}
Expand All @@ -122,7 +122,7 @@ export default class AtTabBar extends AtComponent {
) : null}
<View>
<AtBadge
dot={item.iconType ? '' : item.dot}
dot={item.iconType ? false : !!item.dot}
value={item.iconType ? '' : item.text}
max={item.iconType ? '' : item.max}
>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/action/activity-indicator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export default class ActivityIndicatorPage extends Taro.Component {
<View className='panel__content'>
<View className='example-item'>
<View className='subitem'>
<AtActivityIndicator size='20' ></AtActivityIndicator>
<AtActivityIndicator size={20} ></AtActivityIndicator>
</View>
<View className='subitem'>
<AtActivityIndicator size='24' />
<AtActivityIndicator size={24} />
</View>
<View className='subitem'>
<AtActivityIndicator size='32' />
<AtActivityIndicator size={32} />
</View>
</View>
</View>
Expand Down
34 changes: 17 additions & 17 deletions src/pages/action/progress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ export default class ProgressPage extends Taro.Component {
<View className='panel__title'>基础进度条</View>
<View className='panel__content'>
<View className='example-item'>
<AtProgress percent='25' />
<AtProgress percent={25} />
</View>
<View className='example-item'>
<AtProgress percent='50' />
<AtProgress percent={50} />
</View>
<View className='example-item'>
<AtProgress percent='75' />
<AtProgress percent={75} />
</View>
</View>
</View>
Expand All @@ -79,10 +79,10 @@ export default class ProgressPage extends Taro.Component {
<View className='panel__title'>隐藏进度文案</View>
<View className='panel__content'>
<View className='example-item'>
<AtProgress percent='25' isHidePercent />
<AtProgress percent={25} isHidePercent />
</View>
<View className='example-item'>
<AtProgress percent='75' isHidePercent />
<AtProgress percent={75} isHidePercent />
</View>
</View>
</View>
Expand All @@ -92,13 +92,13 @@ export default class ProgressPage extends Taro.Component {
<View className='panel__title'>自定义进度条线宽</View>
<View className='panel__content'>
<View className='example-item'>
<AtProgress percent='25' strokeWidth='6' />
<AtProgress percent={25} strokeWidth={6} />
</View>
<View className='example-item'>
<AtProgress percent='50' strokeWidth='8' />
<AtProgress percent={50} strokeWidth={8} />
</View>
<View className='example-item'>
<AtProgress percent='75' strokeWidth='10' />
<AtProgress percent={75} strokeWidth={10} />
</View>
</View>
</View>
Expand All @@ -108,13 +108,13 @@ export default class ProgressPage extends Taro.Component {
<View className='panel__title'>自定义颜色</View>
<View className='panel__content'>
<View className='example-item'>
<AtProgress percent='25' color='#FF4949' />
<AtProgress percent={25} color='#FF4949' />
</View>
<View className='example-item'>
<AtProgress percent='50' color='#13CE66' />
<AtProgress percent={50} color='#13CE66' />
</View>
<View className='example-item'>
<AtProgress percent='75' color='#FFC82C' />
<AtProgress percent={75} color='#FFC82C' />
</View>
</View>
</View>
Expand All @@ -125,19 +125,19 @@ export default class ProgressPage extends Taro.Component {
<View className='panel__content'>
<View className='example-item'>
<View className='example-item__desc'>暂停</View>
<AtProgress percent='25' />
<AtProgress percent={25} />
</View>
<View className='example-item'>
<View className='example-item__desc'>进行中</View>
<AtProgress percent='50' status='progress' />
<AtProgress percent={50} status='progress' />
</View>
<View className='example-item'>
<View className='example-item__desc'>错误</View>
<AtProgress percent='75' status='error' />
<AtProgress percent={75} status='error' />
</View>
<View className='example-item'>
<View className='example-item__desc'>已完成</View>
<AtProgress percent='100' status='success' />
<AtProgress percent={100} status='success' />
</View>
</View>
</View>
Expand All @@ -151,12 +151,12 @@ export default class ProgressPage extends Taro.Component {
<View className='example-item__buttons'>
<View className='btn'>
<AtButton size='small' onClick={this.reduce}>
<AtIcon value='subtract' size='12' />
<AtIcon value='subtract' size={12} />
</AtButton>
</View>
<View className='btn'>
<AtButton size='small' onClick={this.increase}>
<AtIcon value='add' size='12' />
<AtIcon value='add' size={12} />
</AtButton>
</View>
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/view/badge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default class BadgePage extends Taro.Component {
<View className='panel__content'>
<View className='badge-item'>
<View className='subitem'>
<AtBadge value='10' maxValue='99'>
<AtBadge value='10' maxValue={99}>
<AtButton size='small' circle>按钮</AtButton>
</AtBadge>
</View>
<View className='subitem'>
<AtBadge value='100' maxValue='99'>
<AtBadge value='100' maxValue={99}>
<AtButton size='small'>按钮</AtButton>
</AtBadge>
</View>
Expand Down

0 comments on commit 9760c2f

Please sign in to comment.