types: using unknown instead of any (#8152)
* types: using unknown instead of any * chore: UnknownProp
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ref, computed, defineComponent, PropType } from 'vue';
|
||||
import { addUnit } from '../utils';
|
||||
import { addUnit, UnknownProp } from '../utils';
|
||||
import Icon from '../icon';
|
||||
|
||||
export type CheckerShape = 'square' | 'round';
|
||||
@@ -15,10 +15,10 @@ export type CheckerParent = {
|
||||
};
|
||||
|
||||
export const checkerProps = {
|
||||
name: null as any,
|
||||
name: UnknownProp,
|
||||
disabled: Boolean,
|
||||
iconSize: [Number, String],
|
||||
modelValue: null as any,
|
||||
modelValue: UnknownProp,
|
||||
checkedColor: String,
|
||||
labelPosition: String as PropType<CheckerLabelPosition>,
|
||||
labelDisabled: Boolean,
|
||||
|
||||
@@ -54,7 +54,7 @@ export default createComponent({
|
||||
if (parent && props.bindGroup) {
|
||||
return parent.props.modelValue.indexOf(props.name) !== -1;
|
||||
}
|
||||
return props.modelValue;
|
||||
return !!props.modelValue;
|
||||
});
|
||||
|
||||
const toggle = (newValue = !checked.value) => {
|
||||
|
||||
@@ -4,6 +4,7 @@ exports[`should adjust label position when using label-position prop 1`] = `
|
||||
<div role="checkbox"
|
||||
class="van-checkbox"
|
||||
tabindex="0"
|
||||
aria-checked="false"
|
||||
>
|
||||
<span class="van-checkbox__label van-checkbox__label--left">
|
||||
Label
|
||||
|
||||
Reference in New Issue
Block a user