import { use, noop } from '../utils'; import Icon from '../icon'; import Cell from '../cell'; import Button from '../button'; import Radio from '../radio'; import RadioGroup from '../radio-group'; const [sfc, bem, t] = use('contact-list'); export default sfc({ functional: true, props: { value: null, list: Array, addText: String }, render(h, context, inherit) { const { props, listeners } = context; const List = props.list.map((item, index) => ( (
{`${item.name},${item.tel}`}
), 'right-icon': () => ( { event.stopPropagation(); listeners.edit && listeners.edit(item, index); }} /> ) }} onClick={() => { listeners.input && listeners.input(item.id); listeners.select && listeners.select(item, index); }} /> )); return (
{List}
); } });