I've created a basic custom element based on template-custom-element but the component's methods don't seem to being added to the compiled JS.
My component
<h1>Hello {{name}}!</h1>
<button on:click="saySomething()">Click me</button>
<script>
export default {
tag: 'my-app',
data() {
return {
'name': 'World'
}
},
methods: {
saySomething() {
alert('Again, please don\'t do this');
}
}
};
</script>
Clicking on the button throws an error:
Uncaught TypeError: component.saySomething is not a function
at HTMLButtonElement.click_handler (App.html:3)
Full example is here: https://github.com/willtj/template-custom-element
I've created a basic custom element based on template-custom-element but the component's methods don't seem to being added to the compiled JS.
My component
Clicking on the button throws an error:
Full example is here: https://github.com/willtj/template-custom-element