智能客服
你问我答,随时在线为你解决问题

























问题现象:
当开发者未定义properties属性时,在attached中打印的数据将不会包含父组件传递的属性。
问题样例如下所示。
- Component({
- data: {
- id: 100,
- },
- lifetimes: {
- attached () {
- console.info('Component', this.properties)
- },
- detached () {
- console.info('[Component] detached');
- }
- },
- });
解决措施:
开发者在自定义组件时,需在properties中添加相应的属性名称。
- properties:{
- compName: {
- type: String,
- value: ''
- },
- },
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功