perf: add truthProp util (#8522)
* perf: add TruthyProp util * chore: rename * chore: upd
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { computed, watch, defineComponent } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { createNamespace, extend, pick } from '../utils';
|
||||
import { createNamespace, extend, pick, truthProp } from '../utils';
|
||||
import {
|
||||
CHECKBOX_GROUP_KEY,
|
||||
CheckboxGroupProvide,
|
||||
@@ -21,10 +21,7 @@ export default defineComponent({
|
||||
name,
|
||||
|
||||
props: extend({}, checkerProps, {
|
||||
bindGroup: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
bindGroup: truthProp,
|
||||
}),
|
||||
|
||||
emits: ['change', 'update:modelValue'],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ref, computed, PropType, defineComponent } from 'vue';
|
||||
import { addUnit, extend, UnknownProp } from '../utils';
|
||||
import { addUnit, extend, unknownProp, truthProp } from '../utils';
|
||||
import { Icon } from '../icon';
|
||||
|
||||
export type CheckerShape = 'square' | 'round';
|
||||
@@ -15,10 +15,10 @@ export type CheckerParent = {
|
||||
};
|
||||
|
||||
export const checkerProps = {
|
||||
name: UnknownProp,
|
||||
name: unknownProp,
|
||||
disabled: Boolean,
|
||||
iconSize: [Number, String],
|
||||
modelValue: UnknownProp,
|
||||
modelValue: unknownProp,
|
||||
checkedColor: String,
|
||||
labelPosition: String as PropType<CheckerLabelPosition>,
|
||||
labelDisabled: Boolean,
|
||||
@@ -33,10 +33,7 @@ export default defineComponent({
|
||||
role: String,
|
||||
parent: Object as PropType<CheckerParent | null>,
|
||||
checked: Boolean,
|
||||
bindGroup: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
bindGroup: truthProp,
|
||||
bem: {
|
||||
type: Function,
|
||||
required: true as const,
|
||||
|
||||
Reference in New Issue
Block a user