前端定义了一个radiogroup,两个值,然后
items: [
{ boxLabel: i18n.quote_pricestrategy_strategy_count, name: 'strategy',
inputValue: '按数量', checked: true },
{ boxLabel: i18n.quote_pricestrategy_strategy_price, name: 'strategy',
inputValue: '按金额'}
],
bind:{
value: '{selectedObject.strategy}',
},
listeners: {
change: 'onChangeStrategyType'
},
onChangeStrategyType: function (radiogroup,newValue){
console.log(newValue);
console.log(newValue.toString());
var selectObject = this.getViewModel().get('selectedObject');
selectObject.set('strategy');
},
控制台输出
{strategy: '按金额'}
[object Object]
{strategy: '按数量'}
[object Object]
怎么样把这个strategy的字符串值绑定到selectObject的strategy上?
console.log(newValue.strategy.toString());能输出字符串,但是传到后端还是[object Object]这样的字符串
外层 viewmodel,store是objects,所以绑定应该是objects.strategy