UNPKG

vant-fork

Version:

Lightweight Mobile UI Components built on Vue

80 lines (77 loc) 1.97 kB
import Icon from '../icon'; import RouterLink from '../mixins/router-link'; import create from '../utils/create-basic'; export default create({ render: function render() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c('div', { class: [_vm.b({ center: _vm.center, required: _vm.required, clickable: _vm.isLink || _vm.clickable }), { 'van-hairline': _vm.border }], on: { "click": _vm.onClick } }, [_vm._t("icon", [_vm.icon ? _c('icon', { class: _vm.b('left-icon'), attrs: { "name": _vm.icon } }) : _vm._e()]), _vm.isDef(_vm.title) || _vm.$slots.title ? _c('div', { class: _vm.b('title') }, [_vm._t("title", [_c('span', { domProps: { "textContent": _vm._s(_vm.title) } }), _vm.label ? _c('div', { class: _vm.b('label'), domProps: { "textContent": _vm._s(_vm.label) } }) : _vm._e()])], 2) : _vm._e(), _vm.isDef(_vm.value) || _vm.$slots.default ? _c('div', { class: _vm.b('value', { alone: !_vm.$slots.title && !_vm.title }) }, [_vm._t("default", [_c('span', { domProps: { "textContent": _vm._s(_vm.value) } })])], 2) : _vm._e(), _vm._t("right-icon", [_vm.isLink ? _c('icon', { class: _vm.b('right-icon', _vm.arrowDirection), attrs: { "name": "arrow" } }) : _vm._e()]), _vm._t("extra")], 2); }, name: 'cell', components: { Icon: Icon }, mixins: [RouterLink], props: { icon: String, label: String, center: Boolean, isLink: Boolean, required: Boolean, clickable: Boolean, title: [String, Number], value: [String, Number], arrowDirection: String, border: { type: Boolean, default: true } }, methods: { onClick: function onClick() { this.$emit('click'); this.routerLink(); } } });