diff --git a/src/button/README.md b/src/button/README.md index ed7ce0f34..6d1636ba6 100644 --- a/src/button/README.md +++ b/src/button/README.md @@ -106,7 +106,7 @@ Vue.use(Button); | text | Text | *string* | - | | color `v2.1.8` | Color, support linear-gradient | *string* | - | | icon | Left Icon | *string* | - | -| icon-prefix `v2.5.3` | Icon className prefix | *string* | `van-icon` | +| icon-prefix `v2.6.0` | Icon className prefix | *string* | `van-icon` | | tag | HTML Tag | *string* | `button` | | native-type | Native Type Attribute | *string* | `''` | | plain | Whether to be plain button | *boolean* | `false` | diff --git a/src/button/README.zh-CN.md b/src/button/README.zh-CN.md index a89fd5aec..319adbfdb 100644 --- a/src/button/README.zh-CN.md +++ b/src/button/README.zh-CN.md @@ -128,7 +128,7 @@ Vue.use(Button); | text | 按钮文字 | *string* | - | | color `v2.1.8` | 按钮颜色,支持传入`linear-gradient`渐变色 | *string* | - | | icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | *string* | - | -| icon-prefix `v2.5.3` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | *string* | `van-icon` | +| icon-prefix `v2.6.0` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | *string* | `van-icon` | | tag | 根节点的 HTML 标签 | *string* | `button` | | native-type | 原生 button 标签的 type 属性 | *string* | - | | block | 是否为块级元素 | *boolean* | `false` | diff --git a/src/button/index.tsx b/src/button/index.tsx index e85866d58..48764640c 100644 --- a/src/button/index.tsx +++ b/src/button/index.tsx @@ -166,6 +166,7 @@ Button.props = { loading: Boolean, hairline: Boolean, disabled: Boolean, + iconPrefix: String, nativeType: String, loadingText: String, loadingType: String, diff --git a/src/button/test/__snapshots__/index.spec.js.snap b/src/button/test/__snapshots__/index.spec.js.snap index b44289c36..e247ce2a6 100644 --- a/src/button/test/__snapshots__/index.spec.js.snap +++ b/src/button/test/__snapshots__/index.spec.js.snap @@ -1,6 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`loading size 1`] = ` +exports[`icon-prefix prop 1`] = ` + +`; + +exports[`loading-size prop 1`] = ` diff --git a/src/button/test/index.spec.js b/src/button/test/index.spec.js index 36d498735..bd9d96bdb 100644 --- a/src/button/test/index.spec.js +++ b/src/button/test/index.spec.js @@ -1,7 +1,7 @@ import { mount } from '../../../test'; import Button from '..'; -test('loading size', () => { +test('loading-size prop', () => { const wrapper = mount(Button, { propsData: { loading: true, @@ -82,3 +82,14 @@ test('hide border when color is gradient', () => { expect(wrapper.element.style.border).toEqual('0px'); }); + +test('icon-prefix prop', () => { + const wrapper = mount(Button, { + propsData: { + icon: 'success', + iconPrefix: 'my-icon', + }, + }); + + expect(wrapper).toMatchSnapshot(); +});