[Improvement] Dialog: support custom className (#1224)

This commit is contained in:
neverland 2018-06-05 11:57:52 +08:00 committed by GitHub
parent b33c8ef5f2
commit 9b3b17cb42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<template>
<transition name="van-dialog-bounce">
<div v-show="value" :class="b()">
<div v-show="value" :class="[b(), className]">
<div v-if="title" v-text="title" :class="b('header')" />
<div :class="b('content')" class="van-hairline">
<slot>
@ -49,6 +49,7 @@ export default create({
title: String,
message: String,
callback: Function,
className: [String, Object, Array],
beforeClose: Function,
confirmButtonText: String,
cancelButtonText: String,

View File

@ -70,9 +70,10 @@ export default {
|-----------|-----------|-----------|-------------|
| title | Title | `String` | - |
| message | Message | `String` | - |
| showConfirmButton | Whether to show confirm button | `Boolean` | `true` |
| showCancelButton | Whether to show cancel button | `Boolean` | `false` |
| confirmButtonText | Confirm button text | `String` | `Confirm` |
| className | Custom className | `String | Array | Object` | - |
| showConfirmButton | Whether to show confirm button | `Boolean` | `true` |
| showCancelButton | Whether to show cancel button | `Boolean` | `false` |
| confirmButtonText | Confirm button text | `String` | `Confirm` |
| cancelButtonText | Cancel button test | `String` | `Cancel` |
| overlay | Whether to show overlay | `Boolean` | `true` |
| closeOnClickOverlay | Whether to close when click overlay | `Boolean` | `false` |

View File

@ -34,6 +34,7 @@ Dialog.defaultOptions = {
title: '',
message: '',
overlay: true,
className: '',
lockScroll: true,
beforeClose: null,
confirmButtonText: '',

View File

@ -71,9 +71,10 @@ export default {
|-----------|-----------|-----------|-------------|
| title | 标题 | `String` | - |
| message | 内容 | `String` | - |
| showConfirmButton | 是否展示确认按钮 | `Boolean` | `true` |
| showCancelButton | 是否展示取消按钮 | `Boolean` | `false` |
| confirmButtonText | 确认按钮的文案 | `String` | `确认` |
| className | 自定义类名 | `String | Array | Object` | - |
| showConfirmButton | 是否展示确认按钮 | `Boolean` | `true` |
| showCancelButton | 是否展示取消按钮 | `Boolean` | `false` |
| confirmButtonText | 确认按钮的文案 | `String` | `确认` |
| cancelButtonText | 取消按钮的文案 | `String` | `取消` |
| overlay | 是否展示蒙层 | `Boolean` | `true` |
| closeOnClickOverlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |