Skip to content
Advertisement

Failed to mount component: template or render function not defined using vue.js

I’m learning vue. js .I’m trying to make simple form by using vue.js but I got above error while making a form. I tried but unable to fix the problem. Please help me.

JavaScript

Advertisement

Answer

UPDATE

If you are using cli-vue : https://cli.vuejs.org/

Assume you put file in App.vue :

JavaScript

Dont use jquery in Vue project. If you want to use bootstrap you can use bootsrap-vue : https://bootstrap-vue.js.org/

But if you are using vue in html use this : https://v2.vuejs.org/v2/guide/

Previous

First, have you read vuejs introduction in https://v2.vuejs.org/v2/guide/ and Vue Lesson on Scrimba ?

About the question. <template> are used in component. You can replace it to <div id="app"> :

JavaScript

Then you create vue instance in the <script> tag :

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement