diff --git a/example/pages/goods-action/index.wxml b/example/pages/goods-action/index.wxml index 0a2ab4ae..c1575e7d 100644 --- a/example/pages/goods-action/index.wxml +++ b/example/pages/goods-action/index.wxml @@ -32,4 +32,13 @@ + + + + + + + + + diff --git a/packages/goods-action-button/index.ts b/packages/goods-action-button/index.ts index 4ea25fd4..9112c122 100644 --- a/packages/goods-action-button/index.ts +++ b/packages/goods-action-button/index.ts @@ -9,6 +9,7 @@ VantComponent({ props: { text: String, + color: String, loading: Boolean, disabled: Boolean, type: { diff --git a/packages/goods-action-button/index.wxml b/packages/goods-action-button/index.wxml index 39296d59..052b9210 100644 --- a/packages/goods-action-button/index.wxml +++ b/packages/goods-action-button/index.wxml @@ -4,6 +4,7 @@ size="large" lang="{{ lang }}" type="{{ type }}" + color="{{ color }}" loading="{{ loading }}" disabled="{{ disabled }}" open-type="{{ openType }}" diff --git a/packages/goods-action/README.md b/packages/goods-action/README.md index e602849c..095a2deb 100644 --- a/packages/goods-action/README.md +++ b/packages/goods-action/README.md @@ -66,6 +66,20 @@ Page({ ``` +### 自定义按钮颜色 + +通过`color`属性可以自定义按钮的颜色,支持传入`linear-gradient`渐变色 + +```html + + + + + + + +``` + ## API ### GoodsAction API @@ -100,6 +114,7 @@ Page({ | 参数 | 说明 | 类型 | 默认值 | 版本 | |-----------|-----------|-----------|-------------|-------------| | text | 按钮文字 | *string* | - | - | +| color | 按钮颜色,支持传入 `linear-gradient` 渐变色 | *string* | - | - | | url | 跳转链接 | *string* | - | - | | link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | *string* | `navigateTo` | - | | id | 标识符 | *string* | - | - |