You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/packages/svelte/test/runtime/samples/attribute-casing-custom-ele.../main.svelte

26 lines
429 B

<script>
class MyCustomElement extends HTMLElement {
constructor() {
super();
this._obj = null;
}
set camelCase(obj) {
this._obj = obj;
this.render();
}
connectedCallback() {
this.render();
}
render() {
this.innerHTML = 'Hello ' + this._obj.text + '!';
}
}
window.customElements.define('my-custom-element', MyCustomElement);
</script>
<my-custom-element camelCase={{ text: 'World' }} />