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中使用