在写vue的时候报错:

Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

直译出来 就是:组件模板应该包含一个根元素。如果在多个元素上使用V-IF,则使用V-ELS-IF来链接它们。

其实就是该处只能有一个根元素,如果存在多个就会报错。
解决办法就是用一个根元素将所有的元素都包起来。

错误【Component template should contain exactly one root element】多个根元素

相关文章:

  • 2021-07-26
  • 2021-05-17
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2021-10-10
  • 2021-06-17
  • 2022-01-21
  • 2021-10-07
相关资源
相似解决方案