We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
like:
<slot name="my-slot" slot="outer-slot" />
test cases:
// glass-easel/tests/core/slot.test.ts test('should support slot as slot content', () => { const comp = componentSpace .define() .options({ multipleSlots: true, }) .template( tmpl(` <div>comp</div> <slot name="comp-slot"></slot> `), ) .registerComponent() const child = componentSpace .define() .options({ multipleSlots: true, }) .usingComponents({ comp }) .template( tmpl(` <comp> <div>child</div> <slot name="child-slot" slot="comp-slot" /> </comp> `), ) .registerComponent() const parent = componentSpace .define() .usingComponents({ child }) .template( tmpl(` <child> <div slot="child-slot">content</div> </child> `), ) .registerComponent() const parentElem = glassEasel.Component.createWithContext( 'root', parent.general(), testBackend, ) expect(domHtml(parentElem)).toBe( '<child><comp><div>comp</div><div>content</div></comp></child>', ) }) test('should support slot as slot content with virtual host and placeholder', () => { const placeholder = componentSpace .define() .options({ multipleSlots: true, virtualHost: true, }) .template( tmpl(` <div>placeholder</div> <slot name="content"></slot> `), ) .registerComponent() const child = componentSpace .define() .options({ multipleSlots: true, virtualHost: true, }) .usingComponents({ comp: 'comp', placeholder }) .placeholders({ comp: 'placeholder' }) .template( tmpl(` <comp> <div>child</div> <slot name="content" slot="content" /> </comp> `), ) .registerComponent() const parent = componentSpace .define() .usingComponents({ child }) .template( tmpl(` <child> <div slot="content">content</div> </child> `), ) .registerComponent() const parentElem = glassEasel.Component.createWithContext( 'root', parent.general(), testBackend, ) expect(domHtml(parentElem)).toBe('<div>placeholder</div><div>content</div>') componentSpace .define('comp') .options({ multipleSlots: true, }) .template( tmpl(` <div>comp</div> <slot name="content"></slot> `), ) .registerComponent() expect(domHtml(parentElem)).toBe('<comp><div>comp</div><div>content</div></comp>') })
The text was updated successfully, but these errors were encountered:
Fixed in 19f3f91
Sorry, something went wrong.
LastLeaf
No branches or pull requests
like:
test cases:
The text was updated successfully, but these errors were encountered: