/
githubmirror
/
Motrix
Обзор
Документация
Войти
/
githubmirror
/
Motrix
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/renderer/components/Subnav/TaskSubnav.vue
64 строки
1 KB
Dr_rOot
refactor: style code format
07 май 2021, 16:25
07 май 2021, 16:25
a4fb082
Код
Авторство
О чём код?
<template> <nav class="subnav-inner"> <h3>{{ title }}</h3> <ul> <li @click="() => nav('active')" :class="[ current === 'active' ? 'active' : '' ]" > <i class="subnav-icon"> <mo-icon name="task-start" width="20" height="20" /> </i> <span>{{ $t('task.active') }}</span> </li> <li @click="() => nav('waiting')" :class="[ current === 'waiting' ? 'active' : '' ]" > <i class="subnav-icon"> <mo-icon name="task-pause" width="20" height="20" /> </i> <span>{{ $t('task.waiting') }}</span> </li> <li @click="() => nav('stopped')" :class="[ current === 'stopped' ? 'active' : '' ]" > <i class="subnav-icon"> <mo-icon name="task-stop" width="20" height="20" /> </i> <span>{{ $t('task.stopped') }}</span> </li> </ul> </nav> </template> <script> import '@/components/Icons/task-start' import '@/components/Icons/task-pause' import '@/components/Icons/task-stop' export default { name: 'mo-task-subnav', props: { current: { type: String, default: 'active' } }, computed: { title () { return this.$t('subnav.task-list') } }, methods: { nav (status = 'active') { this.$router.push({ path: `/task/${status}` }).catch(err => { console.log(err) }) } } } </script>