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

后端 未结 8 2139
予麋鹿
予麋鹿 2020-11-29 04:37

I don\'t know what the error is, so far I am testing through console log to check for changes after selecting a file (for uploading).

When I run $ npm run watc

8条回答
  •  甜味超标
    2020-11-29 04:58

    I was confused as I knew VueJS should only contain 1 root element and yet I was still getting this same "template syntax error Component template should contain exactly one root element..." error on an extremely simple component. Turns out I had just mispelled as and that was giving me this same error in a few files I copied and pasted. In summary, check your syntax for any mispellings in your component.

提交回复
热议问题