perf: add truthProp util (#8522)
* perf: add TruthyProp util * chore: rename * chore: upd
This commit is contained in:
+8
-5
@@ -1,5 +1,11 @@
|
||||
import { PropType, CSSProperties, defineComponent } from 'vue';
|
||||
import { isDef, addUnit, isNumeric, createNamespace } from '../utils';
|
||||
import {
|
||||
isDef,
|
||||
addUnit,
|
||||
isNumeric,
|
||||
truthProp,
|
||||
createNamespace,
|
||||
} from '../utils';
|
||||
|
||||
const [name, bem] = createNamespace('badge');
|
||||
|
||||
@@ -12,14 +18,11 @@ export default defineComponent({
|
||||
color: String,
|
||||
offset: (Array as unknown) as PropType<[string | number, string | number]>,
|
||||
content: [Number, String],
|
||||
showZero: truthProp,
|
||||
tag: {
|
||||
type: String as PropType<keyof HTMLElementTagNameMap>,
|
||||
default: 'div',
|
||||
},
|
||||
showZero: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { slots }) {
|
||||
|
||||
Reference in New Issue
Block a user