vue中的错误日志

一、Error compiling template: Component template requires a root element, rather than just text. 这个错误意思是,每一个组件中的模板必须含有根元素,不能直接写文本

二、Do not use built-in or reserved HTML elements as component id: div 不用把html元素当做组件的名称去使用

三、Unknown custom element: <as> - did you register the component correctly? For recursive components, make sure to provide the "name" option. 组件名称没有被解析

四、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. 模板有且只能有一个根标签

五、Property or method "msg" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. msg没有定义

六、The "data" option should be a function that returns a per-instance value in component definitions 组件中的data应该是一个函数

七、The data property "msg" is already declared as a prop. Use prop default value instead. 这个错误的意思是,你已经定义了一个prop 是msg,那么data属性就冲突了,并且被替代为prop ,prop不能喝data重复

原文地址:https://www.cnblogs.com/ly1368489670/p/12704730.html