提交 fe5ae3b0 编写于 作者: A Alfredo Sumaran

Adde TotalTimeComponent as global component

上级 06fd2879
......@@ -45,14 +45,7 @@
</span>
</div>
<div class="item-time">
<span class="hours" v-if="issue.totalTime.hours">
{{ issue.totalTime.hours }}
<abbr title="Hours">hr</abbr>
</span>
<span class="minutes" v-if="issue.totalTime.minutes">
{{ issue.totalTime.minutes }}
<abbr title="Minutes">mins</abbr>
</span>
<total-time :time="issue.totalTime"></total-time>
</div>
</div>
`,
......
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.TotalTimeComponent = Vue.extend({
props: {
time: Object,
},
template: `
<span>
<span class="days" v-if="time.days">
{{ time.days }}
<abbr title="Days">{{ time.days === 1 ? 'day' : 'days' }}</abbr>
</span>
<span class="hours" v-if="time.hours">
{{ time.hours }}
<abbr title="Hours">hr</abbr>
</span>
<span class="mins" v-if="time.mins">
{{ time.mins }}
<abbr title="Minutes">mins</abbr>
</span>
<span class="seconds hide" v-if="time.seconds">
{{ time.seconds }}
<abbr title="Seconds">s</abbr>
</span>
</span>
`,
});
})(window.gl || (window.gl = {}));
......@@ -115,4 +115,7 @@ $(() => {
},
},
});
// Register global components
Vue.component('total-time', gl.cycleAnalytics.TotalTimeComponent);
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册