mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[new feature] Button: add loading-text prop (#1300)
This commit is contained in:
parent
cbdccdf820
commit
59efba991b
@ -19,8 +19,8 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
<demo-block title="加载状态" padding>
|
<demo-block title="加载状态" padding>
|
||||||
<van-button loading type="primary" class="demo-margin-right" loading-class="loading" />
|
<van-button loading type="primary" class="demo-margin-right" />
|
||||||
<van-button loading type="danger" loading-class="loading" />
|
<van-button loading type="danger" loading-text="加载中..." />
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
<demo-block title="按钮形状" padding>
|
<demo-block title="按钮形状" padding>
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
.loading {
|
|
||||||
margin: 0 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
height: 44px;
|
height: 44px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-button loading type="primary" />
|
<van-button loading type="primary" />
|
||||||
<van-button loading type="danger" />
|
<van-button loading type="danger" loading-text="加载中..." />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 按钮形状
|
#### 按钮形状
|
||||||
|
@ -125,4 +125,10 @@
|
|||||||
&--disabled {
|
&--disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__loading-text {
|
||||||
|
margin-left: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ VantComponent({
|
|||||||
square: Boolean,
|
square: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
|
loadingText: String,
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
value: 'default'
|
value: 'default'
|
||||||
|
@ -23,11 +23,18 @@
|
|||||||
bindlaunchapp="bindLaunchApp"
|
bindlaunchapp="bindLaunchApp"
|
||||||
bindopensetting="bindOpenSetting"
|
bindopensetting="bindOpenSetting"
|
||||||
>
|
>
|
||||||
|
<block wx:if="{{ loading }}">
|
||||||
<van-loading
|
<van-loading
|
||||||
wx:if="{{ loading }}"
|
|
||||||
custom-class="loading-class"
|
custom-class="loading-class"
|
||||||
size="{{ size === 'mini' ? '14px' : '20px' }}"
|
size="{{ size === 'mini' ? '14px' : '20px' }}"
|
||||||
color="{{ type === 'default' ? '#c9c9c9' : '' }}"
|
color="{{ type === 'default' ? '#c9c9c9' : '' }}"
|
||||||
/>
|
/>
|
||||||
|
<view
|
||||||
|
wx:if="{{ loadingText }}"
|
||||||
|
class="van-button__loading-text"
|
||||||
|
>
|
||||||
|
{{ loadingText }}
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
<slot wx:else />
|
<slot wx:else />
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user