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

后端 未结 8 2114
予麋鹿
予麋鹿 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条回答
  •  萌比男神i
    2020-11-29 05:00

    Note This answer only applies to version 2.x of Vue. Version 3 has lifted this restriction.

    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.

提交回复
热议问题