import { use } from '../utils'; import { emit, inherit } from '../utils/functional'; import Icon from '../icon'; import Cell from '../cell'; import Radio from '../radio'; const [sfc, bem] = use('address-item'); function AddressItem(h, props, slots, ctx) { const { disabled, switchable } = props; const renderRightIcon = () => ( { event.stopPropagation(); emit(ctx, 'edit'); }} /> ); const renderContent = () => { const { data } = props; const Info = [
{`${data.name},${data.tel}`}
,
{data.address}
]; return props.disabled ? Info : {Info}; }; const onSelect = () => { if (props.switchable) { emit(ctx, 'select'); } }; return ( ); } AddressItem.props = { data: Object, disabled: Boolean, switchable: Boolean }; export default sfc(AddressItem);