New to VueJS and was going through the tutorial. Here are the steps i did
- Created Project using VUE CLI
Tried to Create a component with this code.
var data = { items: [{ text: 'Bananas', checked: true }, { text: 'Apples', checked: false } ], title: 'My Shopping List', newItem: '' }; Vue.component('items-component', { data: function () { return data; }, template: ` <div class="blog-post"> <span>sample</span> </div> ` });
Added this to App.vue template part.
<items-component></items-component>
However i am getting this error
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
Questions
Is there a way we can create multiple components in a Vue Cli Project in one file or multiple files are the only way to create the components?.
is manual editing webpack with CLI a good option?. If so, are there any good links for the same.
Please let me know