types: using unknown instead of any (#8152)

* types: using unknown instead of any

* chore: UnknownProp
This commit is contained in:
neverland
2021-02-14 12:37:02 +08:00
committed by GitHub
parent 393b2a256f
commit 08e928111b
23 changed files with 81 additions and 56 deletions
+3 -3
View File
@@ -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,
+1 -1
View File
@@ -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