老师麻烦解答下这个位置的props
来源:4-3 tab 组件抽象和封装

qq_慕移动6173578
2019-09-23
<template slot-scope="props">
<div class="text">
<support-ico
v-if="props.txt.type>=1"
:size=3
:type="props.txt.type"
></support-ico>
<span>{{props.txt.name}}</span>
<span class="num" v-if="props.txt.count">
<bubble :num="props.txt.count"></bubble>
</span>
</div>
</template>
``
这段代码里面的props不太明白,props为什么打印出来是goods接口里面的数据?
写回答
1回答
-
ustbhuangyi
2019-09-23
这个是 slot-scope 的语法,新版已废弃,用 v-slot 替代,参考 https://cn.vuejs.org/v2/api/#slot-scope-%E5%BA%9F%E5%BC%83。
props 为什么是 goods 里的数据,这个是 cube-scroll-nav-bar 做的,会传入一些数据,参考:https://didi.github.io/cube-ui/#/zh-CN/docs/scroll-nav-bar00
相似问题