File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -107,5 +107,38 @@ export default ({
107107 'customElements.define("text-field", TextField)' ,
108108 'typescript'
109109 ) }
110+ ${ Heading ( 'WebComponent solution' , 'h3' ) }
111+ < p >
112+ There is already a Markup based web components solution you can
113+ use to make your web component creation easy and still take
114+ advantage of Markup reactive template.
115+ </ p >
116+ ${ CodeSnippet (
117+ 'class TextField extends WebComponent {\n' +
118+ ' static observedAttributes = ["value", "disabled"];\n' +
119+ ' value = "";\n' +
120+ ' disabled = false;\n' +
121+ ' \n' +
122+ ' render() {\n' +
123+ ' return html`\n' +
124+ ' <input \n' +
125+ ' type="text" \n' +
126+ ' value="${this.props.value}"\n' +
127+ ' disabled="${this.props.disabled}"\n' +
128+ ' />\n' +
129+ ' `\n' +
130+ ' }\n' +
131+ '}\n' +
132+ '\n' +
133+ 'customElements.define("text-field", TextField)' ,
134+ 'typescript'
135+ ) }
136+ < p >
137+ You can learn more about this powerful tool by checking the
138+ < a
139+ href ="https://www.npmjs.com/package/@beforesemicolon/web-component "
140+ > WebComponent package</ a
141+ > .
142+ </ p >
110143 ` ,
111144 } )
You can’t perform that action at this time.
0 commit comments