Vue学习中的错误

1.Avoid using non-primitive value as key, use string/number value instead.
Duplicate keys detected: ‘[object Object]’. This may cause an update error.
问题的解决:
原来错误发生在这句代码上面:

template:“

Hello World

Hello Time


正确的写法应该是这样:应该使用一个根元素把多个元素包括起来。

template:“

Hello World

Hello Time

2.页面无法渲染
控制台已取到值,页面无渲染是因为后台传的json对象名和前台接收的不一致
调用某个方法 他的 obj.xxx就是控制层中map传过来的值
ForEach报错也是这个对象和后台穿过来的不一样,可能是写错了

3.vue-service查不到数据
看方法需要的是传对象还是参数,参数用 +param 对象用 ,param
Vue学习中的错误
4.运行vue时浏览器报错Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the “name” option
原因:被引用的组件页面没有进行export,导致寻找不到浏览器console报错,但是编译的时候没有语法问题不报错
解决:
方法1: export { default as AppMain } from ‘./AppMain’
方法2:将vue/dist/vue.esm.js注销,修改为vue/dist/vue.min.js

5.Vue学习中的错误Vue学习中的错误
应该使用一个根元素把多个元素包括起来。
template:“

Hello World

Hello Time

” 改为
template:"

Hello World

Hello Time