/
githubmirror
/
Motrix
Обзор
Документация
Войти
/
githubmirror
/
Motrix
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/renderer/components/Task/TaskStatus.vue
45 строк
1 KB
Dr_rOot
refactor: task detail tab content scrollable
05 май 2021, 17:36
05 май 2021, 17:36
e9e86fb
Код
Авторство
О чём код?
<template> <el-tag :effect="theme" class="tag-task-status" :type="type"> {{ status && status.toUpperCase() }} </el-tag> </template> <script> import { APP_THEME, TASK_STATUS } from '@shared/constants' import colors from '@shared/colors' const statusTypeMap = { [TASK_STATUS.ACTIVE]: 'success', [TASK_STATUS.WAITING]: 'info', [TASK_STATUS.PAUSED]: 'info', [TASK_STATUS.ERROR]: 'danger', [TASK_STATUS.COMPLETE]: 'success', [TASK_STATUS.REMOVED]: 'info', [TASK_STATUS.SEEDING]: 'success' } export default { name: 'mo-task-status', props: { theme: { type: String, default: APP_THEME.DARK, validator: function (value) { return [APP_THEME.LIGHT, APP_THEME.DARK].indexOf(value) !== -1 } }, status: { type: String, default: TASK_STATUS.ACTIVE } }, computed: { type () { return statusTypeMap[this.status] }, color () { return colors[this.status] } } } </script>