})
})
+ test('intersection type with ignore', () => {
+ expect(
+ resolve(`
+ type Foo = { foo: number }
+ type Bar = { bar: string }
+ defineProps<Foo & /* @vue-ignore */ Bar>()
+ `).props,
+ ).toStrictEqual({
+ foo: ['Number'],
+ })
+ })
+
// #7553
test('union type', () => {
expect(
scope: TypeScope,
typeParameters?: Record<string, Node>,
): ResolvedElements {
+ if (
+ node.leadingComments &&
+ node.leadingComments.some(c => c.value.includes('@vue-ignore'))
+ ) {
+ return { props: {} }
+ }
switch (node.type) {
case 'TSTypeLiteral':
return typeElementsToMap(ctx, node.members, scope, typeParameters)
)
if (node.extends) {
for (const ext of node.extends) {
- if (
- ext.leadingComments &&
- ext.leadingComments.some(c => c.value.includes('@vue-ignore'))
- ) {
- continue
- }
try {
const { props, calls } = resolveTypeElements(ctx, ext, scope)
for (const key in props) {