feat(dialog): add extra custom class (#5478)

This commit is contained in:
johnsonwong666 2023-07-10 21:07:54 +08:00 committed by GitHub
parent 7498ed12c3
commit 917ab22907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 14 deletions

View File

@ -303,3 +303,6 @@ Page({
| 类名 | 说明 |
| ---------------------- | ------------ |
| custom-class `v1.10.8` | 根节点样式类 |
| cancle-button-class `v1.10.21` | 取消按钮样式类 |
| confirm-button-class `v1.10.21` | 确认按钮样式类 |

View File

@ -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,

View File

@ -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 }}"

View File

@ -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 }}"

View File

@ -154,7 +154,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<van-button
class="van-goods-action-button van-goods-action-button--warning van-goods-action-button--first"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -205,7 +205,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<van-button
class="van-goods-action-button van-goods-action-button--danger van-goods-action-button--last"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -482,7 +482,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-goods-action-button>
<van-button
class="van-goods-action-button van-goods-action-button--warning van-goods-action-button--first"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -531,7 +531,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-goods-action-button>
<van-button
class="van-goods-action-button van-goods-action-button--danger van-goods-action-button--last"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -729,7 +729,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-goods-action-button>
<van-button
class="van-goods-action-button van-goods-action-button--warning van-goods-action-button--first"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -778,7 +778,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-goods-action-button>
<van-button
class="van-goods-action-button van-goods-action-button--danger van-goods-action-button--last"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -976,7 +976,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-goods-action-button>
<van-button
class="van-goods-action-button van-goods-action-button--warning van-goods-action-button--first"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"
@ -1025,7 +1025,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-goods-action-button>
<van-button
class="van-goods-action-button van-goods-action-button--danger van-goods-action-button--last van-goods-action-button--plain"
customClass="van-goods-action-button__inner"
customClass="van-goods-action-button__inner custom-class"
bind:click="onClick"
bind:contact="onContact"
bind:error="onError"