0👍
You need to add template to component options:
Vue.component('test-component', {
template: ` <form>
<!-- a bunch of HTML markup here... -->
<button type="button" @click="testMethod">Fire a test method...</button>
</form>`,
//..
});
👤xAoc
- [Vuejs]-ERROR in renderer.js from UglifyJs Unexpected token punc «(»
- [Vuejs]-Why all Flow types in my VueJs files ('*.vue') are underlined?
0👍
You should add a template:
Vue.component('test-component', {
data() {
return {
someData: '' // does work!
};
},
template: '<div></div>', // add your template here
mounted() {
console.log('ready'); // does not fire...
},
methods: {
testMethod() {
console.log('here'); // does not fire...
}
}
});
👤Nora
Source:stackexchange.com