UNPKG

vant

Version:

A Vue.js 2.0 Mobile UI at YouZan

37 lines (29 loc) 1.3 kB
'use strict'; exports.__esModule = true; var _utils = require('../utils'); exports.default = (0, _utils.create)({ render: function render() { var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "van-step van-hairline", class: ["van-step--" + _vm.$parent.direction, (_obj = {}, _obj["van-step--" + _vm.status] = _vm.status, _obj)] }, [_c('div', { staticClass: "van-step__circle-container" }, [_vm.status !== 'process' ? _c('i', { staticClass: "van-step__circle" }) : _c('icon', { style: { color: _vm.$parent.activeColor }, attrs: { "name": "checked" } })], 1), _c('div', { staticClass: "van-step__title", style: _vm.titleStyle }, [_vm._t("default")], 2), _c('div', { staticClass: "van-step__line" })]); var _obj; }, name: 'step', beforeCreate: function beforeCreate() { this.$parent.steps.push(this); }, computed: { status: function status() { var index = this.$parent.steps.indexOf(this); var active = this.$parent.active; if (index < active) { return 'finish'; } else if (index === active) { return 'process'; } }, titleStyle: function titleStyle() { return this.status === 'process' ? { color: this.$parent.activeColor } : {}; } } });