[new feature] Dialog: add new prop custom-style

This commit is contained in:
rex 2019-07-30 15:54:28 +08:00 committed by GitHub
parent 54470a77c8
commit 5a6526922f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -134,7 +134,8 @@ Page({
| message | 内容 | `String` | - |
| messageAlign | 内容对齐方式,可选值为`left` `right` | `String` | `center` |
| zIndex | z-index 层级 | `Number` | `100` |
| className | 自定义类名 | `String` | '' |
| className | 自定义类名dialog在自定义组件内时无效 | `String` | '' |
| customStyle | 自定义样式 | `String` | '' |
| selector | 自定义选择器 | `String` | `van-dialog` |
| showConfirmButton | 是否展示确认按钮 | `Boolean` | `true` |
| showCancelButton | 是否展示取消按钮 | `Boolean` | `false` |
@ -171,7 +172,8 @@ Page({
| message | 内容 | `String` | - |
| message-align | 内容对齐方式,可选值为`left` `right` | `String` | `center` |
| z-index | z-index 层级 | `Number` | `100` |
| class-name | 自定义类名 | `String` | '' |
| class-name | 自定义类名dialog在自定义组件内时无效 | `String` | '' |
| customStyle | 自定义样式 | `String` | '' |
| show-confirm-button | 是否展示确认按钮 | `Boolean` | `true` |
| show-cancel-button | 是否展示取消按钮 | `Boolean` | `false` |
| confirm-button-text | 确认按钮的文案 | `String` | `确认` |

View File

@ -12,6 +12,7 @@ type DialogOptions = {
selector?: string;
ariaLabel?: string;
className?: string;
customStyle?: string;
transition?: string;
asyncClose?: boolean;
businessId?: number;
@ -79,6 +80,7 @@ Dialog.defaultOptions = {
zIndex: 100,
overlay: true,
className: '',
customStyle: '',
asyncClose: false,
messageAlign: '',
transition: 'scale',

View File

@ -13,6 +13,7 @@ VantComponent({
message: String,
useSlot: Boolean,
className: String,
customStyle: String,
asyncClose: Boolean,
messageAlign: String,
showCancelButton: Boolean,

View File

@ -4,6 +4,7 @@
overlay="{{ overlay }}"
custom-class="van-dialog {{ className }}"
transition="{{ transition }}"
custom-style="{{ customStyle }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
bind:close="onClickOverlay"
>