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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章