会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Loading
踩坑笔记
首页
新随笔
联系
订阅
管理
2017年9月3日
Vue报错——Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
摘要: 出现这种错误的原因是因为Vue的模板中只能有一个根节点,所以在<template>中尝试插入第二个元素时就会报这个错。 例如: HTML: 结果: 解决办法: 将<template>中的元素用一个<div>包裹起来即可。
阅读全文
posted @ 2017-09-03 00:23 木头人4216
阅读(631)
评论(0)
推荐(0)
公告