老师麻烦解答下这个位置的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-bar

0
0

Vue.js2.5+cube-ui重构饿了么App(经典再升级)

掌握Vue1.0到2.0再到2.5最全版本应用与迭代,打造极致流畅的WebApp

9868 学习 · 4162 问题

查看课程