types(defineComponent): fix missing exported types (#2124)
This commit is contained in:
parent
066d514d75
commit
be27bbc5ad
@ -174,8 +174,11 @@ export {
|
|||||||
ComponentOptionsWithArrayProps,
|
ComponentOptionsWithArrayProps,
|
||||||
ComponentCustomOptions,
|
ComponentCustomOptions,
|
||||||
ComponentOptionsBase,
|
ComponentOptionsBase,
|
||||||
RenderFunction
|
RenderFunction,
|
||||||
|
MethodOptions,
|
||||||
|
ComputedOptions
|
||||||
} from './componentOptions'
|
} from './componentOptions'
|
||||||
|
export { EmitsOptions, ObjectEmitsOptions } from './componentEmits'
|
||||||
export {
|
export {
|
||||||
ComponentPublicInstance,
|
ComponentPublicInstance,
|
||||||
ComponentCustomProperties
|
ComponentCustomProperties
|
||||||
|
@ -10,7 +10,8 @@ import {
|
|||||||
expectType,
|
expectType,
|
||||||
ComponentPublicInstance,
|
ComponentPublicInstance,
|
||||||
ComponentOptions,
|
ComponentOptions,
|
||||||
SetupContext
|
SetupContext,
|
||||||
|
h
|
||||||
} from './index'
|
} from './index'
|
||||||
|
|
||||||
describe('with object props', () => {
|
describe('with object props', () => {
|
||||||
@ -900,3 +901,23 @@ describe('async setup', () => {
|
|||||||
// setup context properties should be mutable
|
// setup context properties should be mutable
|
||||||
vm.a = 2
|
vm.a = 2
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// check if defineComponent can be exported
|
||||||
|
export default {
|
||||||
|
// function components
|
||||||
|
a: defineComponent(_ => h('div')),
|
||||||
|
// no props
|
||||||
|
b: defineComponent({
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
c: defineComponent({
|
||||||
|
props: ['a']
|
||||||
|
}),
|
||||||
|
d: defineComponent({
|
||||||
|
props: {
|
||||||
|
a: Number
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@vue/*": ["../packages/*/dist"],
|
"@vue/*": ["../packages/*/dist"],
|
||||||
"vue": ["../packages/vue/dist"]
|
"vue": ["../packages/vue/dist"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exclude": ["../packages/*/__tests__", "../packages/*/src"]
|
"exclude": ["../packages/*/__tests__", "../packages/*/src"],
|
||||||
|
"include": [
|
||||||
|
"../packages/global.d.ts",
|
||||||
|
"../packages/*/dist",
|
||||||
|
"../packages/runtime-dom/types/jsx.d.ts",
|
||||||
|
"../packages/*/__tests__",
|
||||||
|
"../test-dts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user