Skip to content

Commit

Permalink
fix(playground): vue2 root element
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Oct 15, 2023
1 parent 5cd2055 commit 81eb3a1
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions playground/vue2/src/examples/define-slots/child.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ defineSlots<Slots>()
</script>

<template>
<slot name="title" foo="foo"><Ok /></slot>
<slot name="default" bar="bar"><Fail /></slot>
<div>
<slot name="title" foo="foo"><Ok /></slot>
<slot name="default" bar="bar"><Fail /></slot>

<!-- For type check -->
<!-- eslint-disable-next-line vue/no-constant-condition -->
<template v-if="false">
<slot name="title" :foo="false" />
<slot name="default" :bar="1" />
<!-- For type check -->
<!-- eslint-disable-next-line vue/no-constant-condition -->
<template v-if="false">
<slot name="title" :foo="false" />
<slot name="default" :bar="1" />

<!-- @vue-expect-error wrong type -->
<slot name="title" :foo="123" />
<!-- @vue-expect-error wrong type -->
<slot name="title" :foo="123" />

<!-- @vue-expect-error missing scope -->
<slot name="default" />
<!-- @vue-expect-error wrong type -->
<slot name="default" bar="baz" />
</template>
<!-- @vue-expect-error missing scope -->
<slot name="default" />
<!-- @vue-expect-error wrong type -->
<slot name="default" bar="baz" />
</template>
</div>
</template>

0 comments on commit 81eb3a1

Please sign in to comment.