aurelia 绑定到无线电输入
示例
基本收音机
export class MyViewModel {
favoriteColor = null;
colors = ['Red', 'Yellow', 'Pink', 'Green', 'Purple', 'Orange', 'Blue'];
}<template>
<label repeat.for="color of colors">
<input type="radio" name="colors" value.bind="color" checked.bind="favoriteColor" />
${color}
</label>
</template>带对象阵列的收音机
export class MyViewModel {
people = [];
selectedPerson = null;
constructor() {
this.people= [
{name: 'John Michaels'},
{name: 'Gary Stevens'},
{name: 'Carrie Smitch'},
{name: 'Jesus Wohau'}
];
}
}<template>
<label repeat.for="person of people">
<input type="radio" name="person" model.bind="person" checked.bind="selectedPerson" />
${person.name}
</label>
</template>带布尔的收音机
export class MyViewModel {
agreeToTerms = null;
}<template> <label><input type="radio" name="terms" model.bind="null" checked.bind="agreeToTerms" />No Answer</label> <label><input type="radio" name="terms" model.bind="true" checked.bind="agreeToTerms" />Yes</label> <label><input type="radio" name="terms" model.bind="false" checked.bind="agreeToTerms" />No</label> </template>
热门推荐
7 简短的二胎祝福语
10 简短霸气女儿生日 祝福语
11 祝福语高考小众诗句简短
12 元旦祝福语20秒简短
13 老师过年祝福语大全 简短
14 一生祝福语简短
15 产检祝福语简短霸气
16 朋友店开张祝福语简短
17 生日爱情祝福语大全简短
18 朋友女儿生日祝福语 简短