[Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instan
来源:互联网 发布:数控加工中心编程视频 编辑:程序博客网 时间:2024/05/16 01:34
做vue的时候 ,老是有一个 warning出现,根据提示到网页看了下解决方案,因为对英语能力掌握较差,所以看来好几遍 才真正的发现自己的问题
warning如下:
[Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instance:
在warnign下面有个链接 http://vuejs.org/guide/components.html#Fragment_Instance
点进去 我就直接找fragment instance这个关键词,ok找到问题了
出现fragment instance有多种情况
There are multiple conditions that will turn a Vue instance into a fragment instance:
- Template contains multiple top-level elements. (模版包涵了多个顶级元素 说白了 你的模版元素没有唯一一个父元素)
- Template contains only plain text.(模版里面只包涵纯文本)
- Template contains only another component (which can potentially be a fragment instance itself).(模版只包含另外一个组件,而这个组件本上可以就是一个fragment instance)
- Template contains only an element directive, e.g.
<partial>
or vue-router’s<router-view>
.(模版只包含<partial>或者<router-view>组件 ) - Template root node has a flow-control directive, e.g.
v-if
orv-for
.(模版根节点被v-if活着v-for有个逻辑判断)
其实,出现问题没什么,我们根据vue的提示链接仔细看,总能找到我们的解决方案。
另外,能吐个槽么?vue报warining的时候 要是能告诉我哪里出的 warning就好了,我可是一个一个模版翻着看呀。。。。。
0 0
- [Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instan
- What is a lightweight component?
- The given project is not a virtual component project
- The given project is not a virtual component project
- The given project is not a virtual component project
- jqGrid is a grid component for ASP.NET & PHP based on the world's most popular and flexible jQuery g
- ”because search permissions are missing on a component of the path“
- [Vue warn]: Do not use built-in or reserved HTML elements as component id:
- Eclipse 提示 The given project is not a virtual component project
- Eclipse 提示 The given project is not a virtual component project
- 问题:Eclipse 提示 The given project is not a virtual component project
- [Vue warn]: Error compiling template Component template requires a root element, rather than just te
- Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
- Vue.js搭建路由报错 router.map is not a function,Cannot read property ‘component’ of undefined
- QT for Android解决The Platform Tools component is missing
- 错误:Component is part of the declaration of 2 modules
- Delphi ''测试...'' is not a valid component name.
- Visual Studio cannot debug managed applications because a kernel debugger is enabled on the system
- vim配色方案设置
- Android录制声音,并播放,功能优化
- 翻翻git之---可以收缩伸展的自定义LinearLayout ExpandableLinearLayout
- git checkout 权限文件被改,问题解决方法
- 前后端分离(一)
- [Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instan
- hduoj 不容易系列之三---1230
- C语言中的assert
- Python 自定义信号处理
- Linux(Ubuntu)下安装NodeJs
- WinCE OAL中的Startup.s介绍
- 医疗web之我思考
- img图片属性
- 网络编程知识(5)--用Netty实现的一个简单的HTTP服务器