fix: ts error

This commit is contained in:
Amour1688 2020-10-10 20:53:50 +08:00
parent 61ef8e6883
commit 4c9d3161fd
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import { createTypes } from 'vue-types'; import { createTypes, VueTypeValidableDef, VueTypesInterface } from 'vue-types';
const PropTypes = createTypes({ const PropTypes = createTypes({
func: undefined, func: undefined,
bool: undefined, bool: undefined,
@ -8,6 +8,7 @@ const PropTypes = createTypes({
object: undefined, object: undefined,
integer: undefined, integer: undefined,
}); });
PropTypes.extend([ PropTypes.extend([
{ {
name: 'looseBool', name: 'looseBool',
@ -16,9 +17,14 @@ PropTypes.extend([
default: undefined, default: undefined,
}, },
]); ]);
export function withUndefined(type: any) { export function withUndefined(type: any) {
type.default = undefined; type.default = undefined;
return type; return type;
} }
export default PropTypes; export default PropTypes as VueTypesInterface & {
readonly looseBool: VueTypeValidableDef<boolean> & {
default: boolean;
};
};

View File

@ -1,4 +1,4 @@
import { nextTick, inject } from 'vue'; import { nextTick, inject, defineComponent } from 'vue';
import TransitionEvents from './css-animation/Event'; import TransitionEvents from './css-animation/Event';
import raf from './raf'; import raf from './raf';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
@ -20,7 +20,7 @@ function isNotGrey(color) {
} }
return true; return true;
} }
export default { export default defineComponent({
name: 'Wave', name: 'Wave',
props: ['insertExtraNode'], props: ['insertExtraNode'],
mounted() { mounted() {
@ -171,4 +171,4 @@ export default {
} }
return this.$slots.default && this.$slots.default()[0]; return this.$slots.default && this.$slots.default()[0];
}, },
}; });