会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
toTo_l
混迹于代码中的流浪汉
博客园
首页
联系
管理
2017年12月13日
组件嵌套时报: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的组件(模板)只能有一个根节点,即.vue文件中的<template>标签下只能有一个子元素。 因此,建议大家在写.vue组件的时候,最好在<template>下添加一个标签(比如div),在这个标签里面写我们的组件。 例如: 我这边就是用
阅读全文
posted @ 2017-12-13 18:22 toTo_l
阅读(776)
评论(0)
推荐(0)
编辑
公告