index.js 825 B

1
  1. "use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/libs/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,_baseComponent.default)({relations:{"../timeline-item/index":{type:"child",observer:function(){this.callDebounceFn(this.updateIsLastElement)}}},properties:{prefixCls:{type:String,value:"wux-timeline"},pending:{type:Boolean,value:!1},position:{type:String,value:"left"}},methods:{updateIsLastElement:function(){var n,e,s,a,t=this.getRelationsByName("../timeline-item/index");0<t.length&&(n=t.length-1,e=this.data,s=e.pending,a=e.position,t.forEach(function(e,t){var i=s?t===Math.max(0,n-1):t===n;e.updateIsLastElement({index:t,isLast:i,isPending:s&&t===n,pending:s,position:a})}))}}});