-
Notifications
You must be signed in to change notification settings - Fork 49
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
How can I render html both in component element and out component element? #294
Comments
I'm not sure of the question. Do you mean you want to wrap what the children of the tag into your button? if so you can get the initial content with @controller
export class PrimaryButtonElement extends HTMLElement {
connectedCallback(){
const initialContent = this.innerHTML;
const itemTemplate = (content:string) => {
return html`<button>${content}???</button>`
}
this.innerHTML=''
render(itemTemplate(initialContent), this);
}
} You will have to get rid of it and re-render it again. <primary-button data-catalyst="">
<button>new issue???</button>
</primary-button> I hope it helps. |
thanks a lot |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
First,define the primary-button component,like this:
Then,use the component like this,
The question is how to render the component's content in the controller?
Thanks!
The text was updated successfully, but these errors were encountered: