error:[vue/valid-template-root]
The template root requires exactly one element.
原因:
因為vue的模版中只有能一個根節點,所以在<template>中插入第二個元素就會報錯
解決方案:
將<template>中的元素先用一個<div>包起來。
<template>
<div>
<p>123</p>
<p>456</p>
</div>
</template>

error:[vue/valid-template-root]
The template root requires exactly one element.
原因:
因為vue的模版中只有能一個根節點,所以在<template>中插入第二個元素就會報錯
解決方案:
將<template>中的元素先用一個<div>包起來。
<template>
<div>
<p>123</p>
<p>456</p>
</div>
</template>

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。