message: [improvement] AddressList: functional
diff: import { use } from '../utils';
  +import { emit, inherit } from '../utils/functional';
  import Button from '../button';
  import RadioGroup from '../radio-group';
  import AddressItem from './Item';
  const [sfc, bem, t] = use('address-list');
  -export default sfc({
  - props: {
  - list: Array,
  - disabledList: Array,
  - disabledText: String,
  - addButtonText: String,
  - value: [String, Number],
  - switchable: {
  - type: Boolean,
  - default: true
  - }
  - },
  -
  - render(h) {
  +function AddressList(h, props, slots, ctx) {
  const getList = (list, disabled) =>
  list.map((item, index) => (
  <AddressItem
  data={item}
  key={item.id}
  disabled={disabled}
  - switchable={this.switchable && !disabled}
  + switchable={props.switchable && !disabled}
  onSelect={() => {
  - this.$emit(disabled ? 'select-disabled' : 'select', item, index);
  + emit(ctx, disabled ? 'select-disabled' : 'select', item, index);
  }}
  onEdit={() => {
  - this.$emit(disabled ? 'edit-disabled' : 'edit', item, index);
  + emit(ctx, disabled ? 'edit-disabled' : 'edit', item, index);
  }}
  />
  ));
  - const List = getList(this.list);
  - const DisabledList = getList(this.disabledList, true);
  + const List = getList(props.list);
  + const DisabledList = getList(props.disabledList, true);
  return (
  - <div class={bem()}>
  - {this.slots('top')}
  - <RadioGroup value={this.value} onInput={event => this.$emit('input', event)}>
  + <div class={bem()} {...inherit(ctx)}>
  + {slots.top && slots.top()}
  + <RadioGroup
  + value={props.value}
  + onInput={event => {
  + emit(ctx, 'input', event);
  + }}
  + >
  {List}
  </RadioGroup>
  - {this.disabledText && <div class={bem('disabled-text')}>{this.disabledText}</div>}
  + {props.disabledText && (
  + <div class={bem('disabled-text')}>{props.disabledText}</div>
  + )}
  {DisabledList}
  - {this.slots()}
  + {slots.default && slots.default()}
  <Button
  square
  size="large"
  type="danger"
  class={bem('add')}
  - text={this.addButtonText || t('add')}
  + text={props.addButtonText || t('add')}
  onClick={() => {
  - this.$emit('add');
  + emit(ctx, 'add');
  }}
  />
  </div>
  );
  }
  -});
  +
  +AddressList.props = {
  + list: Array,
  + disabledList: Array,
  + disabledText: String,
  + addButtonText: String,
  + value: [String, Number],
  + switchable: {
  + type: Boolean,
  + default: true
  + }
  +};
  +
  +export default sfc(AddressList);
  