收藏
回答

关于小程序slot

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 需求 slot 工具 6.5.3 2.0.0

- 需求的场景描述(希望解决的问题)

<component>

    <text>11</text>

    <text>11</text>

    <text>11</text>

</component>


component 是我自定义的控件


我在component中如何给所有 text 外层添加 view




回答关注问题邀请回答
收藏

2 个回答

  • 禾店短剧系统
    禾店短剧系统
    2021-05-27

    可以看一下https://www.jianshu.com/p/5ad047eb97a2

    2021-05-27
    有用 1
    回复
  • 微盟
    微盟
    2019-03-15
    <component>
      <view slot="aaa">
        <text>1111</text>
      </view>
    </component>
     
    <!-- component -->
    <view class="warp">
      <slot name="aaa"></slot>
    </view>


    2019-03-15
    有用
    回复 1
    • 嘿嘿嘿
      嘿嘿嘿
      2019-03-19

      这个单个能实现,但是如果是多个并且在不知名的情况下,就没法实现


      <component>
         <text wx:for="12" slot="aaa">11</text>
       </component>

      这种情况下就没法实现 只能通过其他方法么。

      2019-03-19
      回复
登录 后发表内容