The template root requires exactly one element.(vue/valid-template-root)错误处理

在使用自定义组件的时候 出现的错误

<template>
   <el-row :gutter="20"  class="el-row">
   </el-row>
   <EditApp ></EditApp>
</template>

 因为Vue模版只能有一个根节点,所以需要改动一下即可

<template>
   <div>
     <el-row :gutter="20"  class="el-row">
     </el-row>
     <EditApp ></EditApp>
   </div>
</template>

 


版权声明:本文为kangguang原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。