vue error:The template root requires exactly one element.
生活随笔
收集整理的這篇文章主要介紹了
vue error:The template root requires exactly one element.
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
error:[vue/valid-template-root]
The template root requires exactly one element.
?
原因:
因?yàn)関ue的模版中只有能一個(gè)根節(jié)點(diǎn),所以在<template>中插入第二個(gè)元素就會(huì)報(bào)錯(cuò)
解決方案:
將<template>中的元素先用一個(gè)<div>包起來(lái)。
<template><div><p>123</p><p>456</p></div> </template>
?
本文轉(zhuǎn)載于:猿2048https://www.mk2048.com/blog/blog.php?id=hjchaa&title=vue error:The template root requires exactly one element.
總結(jié)
以上是生活随笔為你收集整理的vue error:The template root requires exactly one element.的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: CSS 小结笔记之滑动门技术
- 下一篇: 自从我这样撸代码以后,公司网页的浏览量提