mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] Button: add text prop (#563)
This commit is contained in:
parent
cb7b333942
commit
041cc1e614
@ -69,6 +69,7 @@ Use `tag` prop to custom button tag
|
|||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| type | Type | `String` | `default` | `primary` `danger` |
|
| type | Type | `String` | `default` | `primary` `danger` |
|
||||||
| size | Size | `String` | `normal` | `large` `small` `mini` |
|
| size | Size | `String` | `normal` | `large` `small` `mini` |
|
||||||
|
| text | Text | `String` | - | - |
|
||||||
| tag | Tag | `String` | `button` | - |
|
| tag | Tag | `String` | `button` | - |
|
||||||
| native-type | Native Type Attribute | `String` | `''` | - |
|
| native-type | Native Type Attribute | `String` | `''` | - |
|
||||||
| disabled | Whether disable button | `Boolean` | `false` | - |
|
| disabled | Whether disable button | `Boolean` | `false` | - |
|
||||||
|
@ -73,8 +73,9 @@ Vue.use(Button);
|
|||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| type | 按钮类型 | `String` | `default` | `primary` `danger` |
|
| type | 按钮类型 | `String` | `default` | `primary` `danger` |
|
||||||
| size | 按钮尺寸 | `String` | `normal` | `large` `small` `mini` |
|
| size | 按钮尺寸 | `String` | `normal` | `large` `small` `mini` |
|
||||||
|
| text | 按钮文字 | `String` | - | - |
|
||||||
| tag | 按钮标签 | `String` | `button` | 任意`HTML`标签 |
|
| tag | 按钮标签 | `String` | `button` | 任意`HTML`标签 |
|
||||||
| native-type | 按钮类型(原生) | `String` | `''` | - |
|
| native-type | 按钮类型(原生) | `String` | - | - |
|
||||||
| disabled | 是否禁用 | `Boolean` | `false` | - |
|
| disabled | 是否禁用 | `Boolean` | `false` | - |
|
||||||
| loading | 是否显示为加载状态 | `Boolean` | `false` | - |
|
| loading | 是否显示为加载状态 | `Boolean` | `false` | - |
|
||||||
| block | 是否为块级元素 | `Boolean` | `false` | - |
|
| block | 是否为块级元素 | `Boolean` | `false` | - |
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
:color="type === 'default' ? 'black' : 'white'"
|
:color="type === 'default' ? 'black' : 'white'"
|
||||||
/>
|
/>
|
||||||
<span class="van-button__text">
|
<span class="van-button__text">
|
||||||
<slot />
|
<slot>{{ text }}</slot>
|
||||||
</span>
|
</span>
|
||||||
</component>
|
</component>
|
||||||
</template>
|
</template>
|
||||||
@ -35,6 +35,7 @@ export default create({
|
|||||||
name: 'van-button',
|
name: 'van-button',
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
text: String,
|
||||||
block: Boolean,
|
block: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
|
@ -50,14 +50,11 @@ export default create({
|
|||||||
callback: Function,
|
callback: Function,
|
||||||
confirmButtonText: String,
|
confirmButtonText: String,
|
||||||
cancelButtonText: String,
|
cancelButtonText: String,
|
||||||
|
showCancelButton: Boolean,
|
||||||
showConfirmButton: {
|
showConfirmButton: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
showCancelButton: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
overlay: {
|
overlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user