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
+4 -13
View File
@@ -9,7 +9,7 @@ import {
} from 'vue';
// Utils
import { isDef, ComponentInstance, createNamespace } from '../utils';
import { isDef, truthProp, createNamespace, ComponentInstance } from '../utils';
// Composables
import {
@@ -27,12 +27,11 @@ export const DROPDOWN_KEY = Symbol(name);
export type DropdownMenuDirection = 'up' | 'down';
const props = {
overlay: truthProp,
zIndex: [Number, String],
activeColor: String,
overlay: {
type: Boolean,
default: true,
},
closeOnClickOutside: truthProp,
closeOnClickOverlay: truthProp,
duration: {
type: [Number, String],
default: 0.2,
@@ -41,14 +40,6 @@ const props = {
type: String as PropType<DropdownMenuDirection>,
default: 'down',
},
closeOnClickOutside: {
type: Boolean,
default: true,
},
closeOnClickOverlay: {
type: Boolean,
default: true,
},
};
export type DropdownMenuProvide = {