我是第一次使用ionic-framework。我的任务是下一个,我想,当组件打开时,单选按钮应该默认选中。我想选中一个。提前感谢在此输入图像描述Screen imagefile typescripttools.component.html
w1jd8yoj1#
I haven't really grasped the meaning of your component, but I would say that initializing your "radioList" variable to 0 should be sufficient.Also, it would be better to go by the id of your ColorValueObjInterface. it would give, in your .ts
radioList:number = colorValueObj[0]?.id || 0;
And your .html
... <ion-radio type="radio" [value]="item.id" name...></ion-radio> ...
And please, use the code sample btn to post your code
1条答案
按热度按时间w1jd8yoj1#
I haven't really grasped the meaning of your component, but I would say that initializing your "radioList" variable to 0 should be sufficient.
Also, it would be better to go by the id of your ColorValueObjInterface. it would give, in your .ts
And your .html
And please, use the code sample btn to post your code