有没有办法使表单的字段的 className 动态化?
我希望字段的类名根据变量进行更改。
例如 if vm.isTrue == truethen className: 'col-xs-2', else 'col-xs-5'。
我试过这个:
{
className: 'col-xs-2',
key: 'maintenanceYN',
type: 'input',
templateOptions: {
disabled: vm.locked
},
expressionProperties: {
'className': function() {
if(vm.isTrue == true) {
return 'col-xs-2'
} else {
return 'col-xs-5'
}
}
}
}