您当前的位置: 首页 >  微信小程序

彭世瑜

暂无认证

  • 1浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

微信小程序:组件Component接收不到参数id

彭世瑜 发布时间:2021-10-14 18:16:21 ,浏览量:1

custom-component.js

Component({
  properties: {
    id: {
      type: String,
    },
  },
});

custom-component.wxml

{{id}}

Page中使用


发现Component并没有接收到参数id, 需要换一个参数名,比如detail-id, 就可以正常接收到父组件传递过来的参数

修改如下

custom-component.js

Component({
  properties: {
    detailId: {
      type: String,
    },
  },
});

custom-component.wxml

{{detailId}}

Page中使用


关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.2112s