Skip to content

Commit 51935a4

Browse files
author
Elson Correia
committed
update web components package
1 parent f99e933 commit 51935a4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs-src/documentation/web-components.page.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff 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
})

0 commit comments

Comments
 (0)