8000 feat(jsx-directive)!: use v-slots instead of vSlots by zhiyuanzmj · Pull Request #930 · vue-macros/vue-macros · GitHub
[go: up one dir, main page]

Skip to content

feat(jsx-directive)!: use v-slots instead of vSlots #930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: test
  • Loading branch information
zhiyuanzmj committed Mar 13, 2025
commit 3da9f3a7726e62905d2cad7b3e2a290059df07d4
16 changes: 8 additions & 8 deletions packages/jsx-directive/tests/__snapshots__/v-slot.test.ts.snap
Original fil 8000 e line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Comp: FunctionalComponent<
}
> = (props, { slots }) => {
return (
<Child vSlots={{...Object.fromEntries(__MACROS_renderList(slots, (Slot, slotName) => ([[__MACROS_unref(slotName)], (scope) => <>
<Child v-slots={{...Object.fromEntries(__MACROS_renderList(slots, (Slot, slotName) => ([[__MACROS_unref(slotName)], (scope) => <>
<Slot {...scope} />
</>,]))),}}

Expand All @@ -28,25 +28,25 @@ let baz = $ref('')
let show = $ref<boolean | undefined>()
defineRender(() => (
<div>
<Child vSlots={{'bottom': ({ foo }) => <>
<Child v-slots={{'bottom': ({ foo }) => <>
{foo}
<Child vSlots={{'default': () => <>default</>,}}></Child>
<Child v-slots={{'default': () => <>default</>,}}></Child>
</>,}}></Child>

<Comp vSlots={{'default': () => <>default</>,}}></Comp>
<Child vSlots={{'bottom': ({ foo }) => <>{foo}</>,}}></Child>
<Comp v-slots={{'default': () => <>default</>,}}></Comp>
<Child v-slots={{'bottom': ({ foo }) => <>{foo}</>,}}></Child>

<Child baz={baz} vSlots={{'title': ({ foo }) => <>
<Child baz={baz} v-slots={{'title': ({ foo }) => <>
{expectTypeOf<string>(foo)}
</>,}}></Child>

<Child vSlots={{...(show) ? {'bottom': ({ foo }) => <>
<Child v-slots={{...(show) ? {'bottom': ({ foo }) => <>
{foo}
</>,} : null,}}

></Child>

<Child<number> vSlots={{...(show) ? {'title': ({ foo }) => <>
<Child<number> v-slots={{...(show) ? {'title': ({ foo }) => <>
{expectTypeOf<number>(foo)}
{show}
</>,} : (show === false) ? {'center': ({ foo }) => <>
Expand Down
0