From 917ab2290791b1ee4f08b9a976837debf4bd6494 Mon Sep 17 00:00:00 2001 From: johnsonwong666 <64689255+johnsonwong666@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:07:54 +0800 Subject: [PATCH] feat(dialog): add extra custom class (#5478) --- packages/dialog/README.md | 3 +++ packages/dialog/index.ts | 3 ++- packages/dialog/index.wxml | 8 ++++---- packages/goods-action-button/index.wxml | 2 +- .../test/__snapshots__/demo.spec.ts.snap | 16 ++++++++-------- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/packages/dialog/README.md b/packages/dialog/README.md index abfbb9a9..4c855c5c 100644 --- a/packages/dialog/README.md +++ b/packages/dialog/README.md @@ -303,3 +303,6 @@ Page({ | 类名 | 说明 | | ---------------------- | ------------ | | custom-class `v1.10.8` | 根节点样式类 | +| cancle-button-class `v1.10.21` | 取消按钮样式类 | +| confirm-button-class `v1.10.21` | 确认按钮样式类 | + diff --git a/packages/dialog/index.ts b/packages/dialog/index.ts index fecb363c..4d02eecb 100644 --- a/packages/dialog/index.ts +++ b/packages/dialog/index.ts @@ -6,6 +6,7 @@ import type { Action } from './dialog'; VantComponent({ mixins: [button], + classes: ['cancle-button-class', 'confirm-button-class'], props: { show: { @@ -71,7 +72,7 @@ VantComponent({ confirm: false, cancel: false, }, - callback: ((() => {}) as unknown) as ( + callback: (() => {}) as unknown as ( action: string, context: WechatMiniprogram.Component.TrivialInstance ) => void, diff --git a/packages/dialog/index.wxml b/packages/dialog/index.wxml index e1ac81eb..364dd4c2 100644 --- a/packages/dialog/index.wxml +++ b/packages/dialog/index.wxml @@ -33,7 +33,7 @@ size="large" loading="{{ loading.cancel }}" class="van-dialog__button van-hairline--right" - custom-class="van-dialog__cancel" + custom-class="van-dialog__cancel cancle-button-class" custom-style="color: {{ cancelButtonColor }}" bind:click="onCancel" > @@ -44,7 +44,7 @@ size="large" class="van-dialog__button" loading="{{ loading.confirm }}" - custom-class="van-dialog__confirm" + custom-class="van-dialog__confirm confirm-button-class" custom-style="color: {{ confirmButtonColor }}" open-type="{{ confirmButtonOpenType }}" @@ -75,7 +75,7 @@ size="large" loading="{{ loading.cancel }}" class="van-dialog__button van-hairline--right" - custom-class="van-dialog__cancel" + custom-class="van-dialog__cancel cancle-button-class" custom-style="color: {{ cancelButtonColor }}" bind:click="onCancel" > @@ -86,7 +86,7 @@ size="large" class="van-dialog__button" loading="{{ loading.confirm }}" - custom-class="van-dialog__confirm" + custom-class="van-dialog__confirm confirm-button-class" custom-style="color: {{ confirmButtonColor }}" open-type="{{ confirmButtonOpenType }}" diff --git a/packages/goods-action-button/index.wxml b/packages/goods-action-button/index.wxml index b4dfe10a..6451c65a 100644 --- a/packages/goods-action-button/index.wxml +++ b/packages/goods-action-button/index.wxml @@ -10,7 +10,7 @@ disabled="{{ disabled }}" open-type="{{ openType }}" class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast, plain: plain }])}}" - custom-class="van-goods-action-button__inner" + custom-class="van-goods-action-button__inner custom-class" business-id="{{ businessId }}" session-from="{{ sessionFrom }}" app-parameter="{{ appParameter }}" diff --git a/packages/goods-action/test/__snapshots__/demo.spec.ts.snap b/packages/goods-action/test/__snapshots__/demo.spec.ts.snap index cc815d21..c0f9a51b 100644 --- a/packages/goods-action/test/__snapshots__/demo.spec.ts.snap +++ b/packages/goods-action/test/__snapshots__/demo.spec.ts.snap @@ -154,7 +154,7 @@ exports[`should render demo and match snapshot 1`] = ` >