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>
?
本文轉載于:猿2048https://www.mk2048.com/blog/blog.php?id=hjchaa&title=vue error:The template root requires exactly one element.