vue error:The template root requires exactly one element.
生活随笔
收集整理的這篇文章主要介紹了
vue error:The template root requires exactly one element.
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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.
總結
以上是生活随笔為你收集整理的vue error:The template root requires exactly one element.的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CSS 小结笔记之滑动门技术
- 下一篇: html5倒计时秒杀怎么做,vue 设