Any ideas on how to solve this? What is actually the error?","url":"https://ednsquare.com/question/vue-js-error-component-template-should-contain-exactly-one-root-element------CS5DqR","mainEntityOfPage":"https://ednsquare.com/question/vue-js-error-component-template-should-contain-exactly-one-root-element------CS5DqR","image":{"@type":"ImageObject","url":"https://cdn.ednsquare.com/s/*/d8e61c58-683f-4521-8ed9-7b873747514b.png"},"answerCount":2,"upvoteCount":4,"dateCreated":"2019-07-06T13:17:21.000Z","author":{"@type":"Person","name":"Aditya Agrawal","image":"https://cdn.ednsquare.com/s/*/212a3510-ddb5-4aa4-8953-fb98c306dc6c.jpeg","url":"https://ednsquare.com/@aditya"},"acceptedAnswer":{"@type":"Answer","text":"You have two root elements in your template.
...
...
And you need one.
...
...
Essentially in Vue you must have only one root element in your templates.","dateCreated":"2019-07-06T13:19:37.000Z","upvoteCount":3,"url":"https://ednsquare.com/question/thread/d04fd1af-a67b-4341-b95c-f2a1d6b2562c","author":{"@type":"Person","name":"Prasad Patil","image":"https://cdn.ednsquare.com/s/*/f89a1717-2322-4d93-87a4-aba26711217e.jpeg","url":"https://ednsquare.com/@prasad"}},"suggestedAnswer":[{"@type":"Answer","text":"You need to wrap all the html into one single element. ","dateCreated":"2019-07-06T13:21:34.000Z","upvoteCount":3,"url":"https://ednsquare.com/question/thread/0858e932-410a-4be5-a67e-ec533b1358e6","author":{"@type":"Person","name":"Chris Gregori","image":"https://cdn.ednsquare.com/s/*/52236c40-87e8-4b83-b0cc-af13d9104df7.jpeg","url":"https://ednsquare.com/@chrisgreg"}}]}}Ednsquare

Vue js error: Component template should contain exactly one root element

My File.vue is
<template> <div class="form-group"> <label for="avatar" class="control-label">Avatar</label> <input type="file" v-on:change="fileChange" id="avatar"> <div class="help-block"> Help block here updated 4 🍸 ... </div> </div> <div class="col-md-6"> <input type="hidden" name="avatar_id"> <img class="avatar" title="Current avatar"> </div> </template> <script> export default{ methods: { fileChange(){ console.log('Test of file input change') } } } </script>

Any ideas on how to solve this? What is actually the error?

Write your answer...

Never miss a post from Aditya Agrawal, when you sign up for Ednsquare.