module.exports.getClassName = function (option) { if (!option) return ''; if (option.disabled) return 'card--disabled'; if (option.checked) return 'card--active'; } module.exports.maxHeight = function (options, height, maxHeight) { var rows = Math.ceil(options.filter(function (option) { return !option.hide }).length / 3); return Math.min(rows * (height + 8), maxHeight || 350); } module.exports.subName = function (option) { if (!option.options) return ''; var options = option.options .filter(function (option) { return option.checked; }) .map(function (option) { return option.name; }) if (options.length) return ':' + options.join(' '); return '' } module.exports.options = function (options) { return options.filter(function (option) { return !option.hide }) } {{item.name}}{{_.subName(item)}} 无变化 选好了 发送 取消 {{subTitle}} 确定 {{item.name}}{{_.subName(item)}}