From f1e5a51c68689c12574e197a15c98c0984c00792 Mon Sep 17 00:00:00 2001 From: rex Date: Mon, 22 Oct 2018 21:01:09 +0800 Subject: [PATCH] =?UTF-8?q?[new=20feature]=20GoodsAction:=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81open-type=E7=AD=89=E6=9B=B4=E5=A4=9AButton=20API=20(#7?= =?UTF-8?q?98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/pages/goods-action/index.wxml | 2 +- packages/goods-action-button/index.ts | 6 +++-- packages/goods-action-button/index.wxml | 19 ++++++++++++++- packages/goods-action-icon/index.ts | 6 +++-- packages/goods-action-icon/index.wxml | 20 ++++++++++++++++ packages/goods-action/README.md | 32 ++++++++++++++++++++++--- 6 files changed, 76 insertions(+), 9 deletions(-) diff --git a/example/pages/goods-action/index.wxml b/example/pages/goods-action/index.wxml index ab31dfb8..322409da 100644 --- a/example/pages/goods-action/index.wxml +++ b/example/pages/goods-action/index.wxml @@ -3,7 +3,7 @@ {{ text }} diff --git a/packages/goods-action-icon/index.ts b/packages/goods-action-icon/index.ts index 41a5de74..3a3ea908 100644 --- a/packages/goods-action-icon/index.ts +++ b/packages/goods-action-icon/index.ts @@ -1,8 +1,10 @@ -import { link } from '../mixins/link'; import { VantComponent } from '../common/component'; +import { link } from '../mixins/link'; +import { button } from '../mixins/button'; +import { openType } from '../mixins/open-type'; VantComponent({ - mixins: [link], + mixins: [link, button, openType], props: { text: String, diff --git a/packages/goods-action-icon/index.wxml b/packages/goods-action-icon/index.wxml index 647b287c..be4b6ec1 100644 --- a/packages/goods-action-icon/index.wxml +++ b/packages/goods-action-icon/index.wxml @@ -1,7 +1,27 @@ zh_TW 繁体中文,en 英文 | `String` | `en` | +| session-from | 会话来源 | `String` | - | +| send-message-title | 会话内消息卡片标题 | `String` | 当前标题 | +| send-message-path | 会话内消息卡片点击跳转小程序路径 | `String` | 当前分享路径 | +| send-message-img | sendMessageImg | `String` | 截图 | +| show-message-card | 显示会话内消息卡片 | `String` | `false` | ### GoodsActionButton API | 参数 | 说明 | 类型 | 默认值 | |-----------|-----------|-----------|-------------| | text | 按钮文字 | `String` | - | -| type | 按钮类型 | `String` | `danger` | -| disabled | 是否禁用按钮 | `Boolean` | `false` | -| loading | 是否显示为加载状态 | `Boolean` | `false` | | url | 跳转链接 | `String` | - | | link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | `String` | `navigateTo` | +| id | 标识符 | `String` | - | +| type | 按钮类型,可选值为 `primary` `warning` `danger` | `String` | `default` | +| size | 按钮尺寸,可选值为 `normal` `large` `small` `mini` | `String` | `normal` | +| disabled | 是否禁用按钮 | `Boolean` | `false` | +| loading | 是否显示为加载状态 | `Boolean` | `false` | +| open-type | 微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | `String` | - | +| app-parameter | 打开 APP 时,向 APP 传递的参数 | `String` | - | +| hover-start-time | 按住后多久出现点击态,单位毫秒 | `Number` | 20 | +| hover-stay-time | 手指松开后点击态保留时间,单位毫秒 | `Number` | 70 | +| lang | 指定返回用户信息的语言,zh_CN 简体中文,
zh_TW 繁体中文,en 英文 | `String` | `en` | +| session-from | 会话来源 | `String` | - | +| send-message-title | 会话内消息卡片标题 | `String` | 当前标题 | +| send-message-path | 会话内消息卡片点击跳转小程序路径 | `String` | 当前分享路径 | +| send-message-img | sendMessageImg | `String` | 截图 | +| show-message-card | 显示会话内消息卡片 | `String` | `false` | ### Event