types: extract prop types (#8332)

This commit is contained in:
neverland
2021-03-14 10:58:08 +08:00
committed by GitHub
parent 6e026e18c3
commit ceebc22e63
9 changed files with 235 additions and 260 deletions
+11 -11
View File
@@ -1,4 +1,4 @@
import { watch, defineComponent } from 'vue';
import { watch, defineComponent, ExtractPropTypes } from 'vue';
import { UnknownProp, createNamespace } from '../utils';
import { useChildren } from '@vant/use';
import { useLinkField } from '../composables/use-link-field';
@@ -8,23 +8,23 @@ const [name, bem] = createNamespace('radio-group');
export const RADIO_KEY = Symbol(name);
const props = {
disabled: Boolean,
iconSize: [Number, String],
direction: String,
modelValue: UnknownProp,
checkedColor: String,
};
export type RadioGroupProvide = CheckerParent & {
props: {
modelValue: unknown;
};
props: ExtractPropTypes<typeof props>;
updateValue: (value: unknown) => void;
};
export default defineComponent({
name,
props: {
disabled: Boolean,
iconSize: [Number, String],
direction: String,
modelValue: UnknownProp,
checkedColor: String,
},
props,
emits: ['change', 'update:modelValue'],