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
+3 -9
View File
@@ -1,5 +1,5 @@
import { nextTick, PropType, reactive, watch, defineComponent } from 'vue';
import { createNamespace, extend } from '../utils';
import { createNamespace, truthProp, extend } from '../utils';
// Components
import { Tab } from '../tab';
@@ -32,6 +32,8 @@ export default defineComponent({
props: {
title: String,
closeable: truthProp,
swipeable: truthProp,
modelValue: [Number, String],
fieldNames: Object as PropType<CascaderFieldNames>,
placeholder: String,
@@ -40,18 +42,10 @@ export default defineComponent({
type: Array as PropType<CascaderOption[]>,
default: () => [],
},
closeable: {
type: Boolean,
default: true,
},
closeIcon: {
type: String,
default: 'cross',
},
swipeable: {
type: Boolean,
default: true,
},
},
emits: ['close', 'change', 'finish', 'update:modelValue'],