From 041cc1e614a3a355fdda0eae2fab07dc1cb3dbc3 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 23 Jan 2018 11:41:37 +0800 Subject: [PATCH] [Improvement] Button: add text prop (#563) --- docs/markdown/en-US/button.md | 1 + docs/markdown/zh-CN/button.md | 3 ++- packages/button/index.vue | 3 ++- packages/dialog/dialog.vue | 5 +---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/markdown/en-US/button.md b/docs/markdown/en-US/button.md index 20d9f34f0..0eb2c63ea 100644 --- a/docs/markdown/en-US/button.md +++ b/docs/markdown/en-US/button.md @@ -69,6 +69,7 @@ Use `tag` prop to custom button tag |-----------|-----------|-----------|-------------|-------------| | type | Type | `String` | `default` | `primary` `danger` | | size | Size | `String` | `normal` | `large` `small` `mini` | +| text | Text | `String` | - | - | | tag | Tag | `String` | `button` | - | | native-type | Native Type Attribute | `String` | `''` | - | | disabled | Whether disable button | `Boolean` | `false` | - | diff --git a/docs/markdown/zh-CN/button.md b/docs/markdown/zh-CN/button.md index 8dafe15f6..e107dd4ee 100644 --- a/docs/markdown/zh-CN/button.md +++ b/docs/markdown/zh-CN/button.md @@ -73,8 +73,9 @@ Vue.use(Button); |-----------|-----------|-----------|-------------|-------------| | type | 按钮类型 | `String` | `default` | `primary` `danger` | | size | 按钮尺寸 | `String` | `normal` | `large` `small` `mini` | +| text | 按钮文字 | `String` | - | - | | tag | 按钮标签 | `String` | `button` | 任意`HTML`标签 | -| native-type | 按钮类型(原生) | `String` | `''` | - | +| native-type | 按钮类型(原生) | `String` | - | - | | disabled | 是否禁用 | `Boolean` | `false` | - | | loading | 是否显示为加载状态 | `Boolean` | `false` | - | | block | 是否为块级元素 | `Boolean` | `false` | - | diff --git a/packages/button/index.vue b/packages/button/index.vue index 7ba592405..4fe3aab95 100644 --- a/packages/button/index.vue +++ b/packages/button/index.vue @@ -23,7 +23,7 @@ :color="type === 'default' ? 'black' : 'white'" /> - + {{ text }} @@ -35,6 +35,7 @@ export default create({ name: 'van-button', props: { + text: String, block: Boolean, loading: Boolean, disabled: Boolean, diff --git a/packages/dialog/dialog.vue b/packages/dialog/dialog.vue index 4a8f0349b..166bf115e 100644 --- a/packages/dialog/dialog.vue +++ b/packages/dialog/dialog.vue @@ -50,14 +50,11 @@ export default create({ callback: Function, confirmButtonText: String, cancelButtonText: String, + showCancelButton: Boolean, showConfirmButton: { type: Boolean, default: true }, - showCancelButton: { - type: Boolean, - default: false - }, overlay: { type: Boolean, default: true