perf: add truthProp util (#8522)

* perf: add TruthyProp util

* chore: rename

* chore: upd
This commit is contained in:
neverland
2021-04-14 10:26:21 +08:00
committed by GitHub
parent 9381640d2e
commit bd609e1df0
59 changed files with 226 additions and 460 deletions
+5 -10
View File
@@ -6,8 +6,9 @@ import {
pick,
extend,
addUnit,
truthProp,
isFunction,
UnknownProp,
unknownProp,
createNamespace,
} from '../utils';
import { BORDER_TOP, BORDER_LEFT } from '../utils/constant';
@@ -42,27 +43,21 @@ export default defineComponent({
message: [String, Function] as PropType<DialogMessage>,
callback: Function as PropType<(action?: DialogAction) => void>,
allowHtml: Boolean,
className: UnknownProp,
className: unknownProp,
beforeClose: Function as PropType<Interceptor>,
messageAlign: String as PropType<DialogMessageAlign>,
closeOnPopstate: truthProp,
showCancelButton: Boolean,
cancelButtonText: String,
cancelButtonColor: String,
confirmButtonText: String,
confirmButtonColor: String,
showConfirmButton: truthProp,
closeOnClickOverlay: Boolean,
transition: {
type: String,
default: 'van-dialog-bounce',
},
showConfirmButton: {
type: Boolean,
default: true,
},
closeOnPopstate: {
type: Boolean,
default: true,
},
}),
emits: ['confirm', 'cancel', 'update:show'],