是否可以将对象设置为无线电输入的值?
它尝试了这个http://jsfiddle.net/benroe/fah5f/3/,但它不起作用。那是一个错误吗?
#模板
<script id='tempMain' type='text/ractive'>
{{# products}}
<h1>{{name}}</h1>
{{# options:i}}
<div class='radio'>
<label>
<input type='radio' name='{{selectedRadio}}' value='{{options[i]}}'>{{name}}
</label>
</div>
{{/}}
{{/}}
</script>
javascript
productData = [
{ name: 'Cameras', options: [
{ name: 'Canon', price: '396'},
{ name: 'Sony', price: '449'}
]}];
ractive = new Ractive({
el: '#template',
template: '#tempMain',
data: {
products: productData,
selectedRadio: 'no Radio selected'
}
});