mirror of https://github.com/sveltejs/svelte
parent
36137e0e93
commit
081b10add1
@ -0,0 +1,10 @@
|
||||
// Note that custom element names must be unique across tests that can be run at the same time. So we use a verbose element name instead of just `<custom-element>`
|
||||
customElements.define("custom-element-with-settable-only-property", class CustomElement extends HTMLElement {
|
||||
set prop(n) {
|
||||
this.value = n;
|
||||
}
|
||||
|
||||
get prop() {
|
||||
throw new Error("This value is not gettable");
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
import "./custom-element-with-settable-only-property.js"
|
||||
</script>
|
||||
|
||||
<custom-element-with-settable-only-property prop="8"></custom-element-with-settable-only-property>
|
||||
Loading…
Reference in new issue