Replies: 2 comments
-
I'm not sure I understand the question. Maybe you could share a playground link with some comments in the code? Do you mean like this? // simple-greeting.ts
import './x-button.js';
@customElement('simple-greeting')
export class SimpleGreeting extends LitElement {
@state()
isButtonDisabled = false;
toggleDisabled = () => this.isButtonDisabled = !this.isButtonDisabled;
render() {
return html`
<x-button ?disabled="${this.isButtonDisabled}"></x-button>
<button @click=${this.toggleDisabled}>Toggle disabled</button>
`;
}
}
// x-button.ts
@customElement('x-button')
export class MyButton extends LitElement {
@property({ type: Boolean })
disabled = false;
render() {
return html`
<button ?disabled=${this.disabled}>My button</button>
`;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Looks like you have a typo at |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
lit component
use in html
it also log:'t-button',how can forbidden by add a
<slot></slot>
Beta Was this translation helpful? Give feedback.
All reactions