forked from nsjcy/frontEnd/nsjcy

LAPTOP-RI7D261L\Mr Ke
2020-02-13 a2789abb73725738127b03d95c95081b66954916
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<wux-cell-group id="wux-cell-group" wux-class="{{ prefixCls }}" prefixCls="{{ cellGroupPrefixCls }}" title="{{ title }}" label="{{ label }}">
    <block wx:for="{{ common.getOptions(options) }}" wx:for-item="option" wx:key="" wx:if="{{ options.length > 0 }}">
        <wux-radio
            prefixCls="{{ option.prefixCls || 'wux-radio' }}"
            cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
            selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
            thumb="{{ option.thumb }}"
            title="{{ option.title }}"
            label="{{ option.label }}"
            value="{{ option.value }}"
            checked="{{ inputValue === option.value }}"
            disabled="{{ option.disabled }}"
            color="{{ option.color || 'balanced' }}"
            data-index="{{ index }}"
            bind:change="onRadioChange"
        />
    </block>
    <block wx:if="{{ options.length === 0 }}">
        <slot></slot>
    </block>
</wux-cell-group>
 
<wxs module="common">
    module.exports.getOptions = function(options) { return options.map(function(option) { if (option.constructor === 'String') { return { title: option, value: option } } return option }) }
</wxs>