Vue Silk Road

起因

seo搜的

内容

1 查找某一个组件实例化对象

https://stackoverflow.com/questions/35769139/vue-js-children-by-component-name

 // you can use this property:
this.$root.$children[0].$options.name
this.$root.$children.find(child => { return child.$options.name === "name"; });
// in the code of the parent component, access the referenced child component like this:
this.$refs.detailsChild
<!-- Template of the parent component, assuming your child Component is called Details -->
<details v-ref:details-child></details>

2 Duplicate keys detected: ‘0’. This may cause an update error.

错误原因:
在使用v-for的时,都要必须加上一个唯一的key值,但是这里写了两个for循环,尽管都加上了key值,然而又将key的值写成一样的了。所以就导致了警告。

解决办法:
可以将其中一个的key修改一下即可。

<div class="info" v-for="(item, index) in itemList" :key="index"></div>
<div class="info" v-for="(item, index) in itemList" :key="index"></div>

<div class="info" v-for="(item, index) in itemList" :key="'info-'+ index"></div>
<div class="info1" v-for="(item, index) in itemList" :key="'info1-'+ index"></div>

3 Uncaught SyntaxError: Unexpected token <

https://www.jianshu.com/p/f95cbf950e6f
本质为404错误,查看引用文件是不是路径不存在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值