2022-08-17 17:46:49 +08:00
|
|
|
<template>
|
2022-09-27 16:57:23 +08:00
|
|
|
<div>
|
2022-11-28 13:50:53 +08:00
|
|
|
<el-card class="topCard">
|
|
|
|
<el-radio-group v-model="activeName">
|
|
|
|
<el-radio-button class="topButton" size="large" @click="routerTo('/apps/all')" label="all">
|
|
|
|
{{ $t('app.all') }}
|
|
|
|
</el-radio-button>
|
|
|
|
<el-radio-button class="topButton" size="large" @click="routerTo('/apps/installed')" label="installed">
|
|
|
|
{{ $t('app.installed') }}
|
|
|
|
</el-radio-button>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-card>
|
|
|
|
<br />
|
2022-09-27 16:57:23 +08:00
|
|
|
<LayoutContent>
|
|
|
|
<router-view></router-view>
|
|
|
|
</LayoutContent>
|
|
|
|
</div>
|
2022-08-17 17:46:49 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import LayoutContent from '@/layout/layout-content.vue';
|
2022-09-27 16:57:23 +08:00
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
const router = useRouter();
|
2022-11-28 13:50:53 +08:00
|
|
|
|
2022-09-26 16:32:40 +08:00
|
|
|
const activeName = ref('all');
|
|
|
|
|
2022-09-27 16:57:23 +08:00
|
|
|
const routerTo = (path: string) => {
|
|
|
|
router.push({ path: path });
|
2022-09-22 16:16:04 +08:00
|
|
|
};
|
2022-09-27 16:57:23 +08:00
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
const path = router.currentRoute.value.path;
|
|
|
|
if (path === '/apps/all') {
|
|
|
|
activeName.value = 'all';
|
|
|
|
}
|
|
|
|
if (path === '/apps/installed') {
|
|
|
|
activeName.value = 'installed';
|
|
|
|
}
|
|
|
|
if (path === '/apps') {
|
|
|
|
routerTo('/apps/all');
|
|
|
|
}
|
|
|
|
});
|
2022-08-17 17:46:49 +08:00
|
|
|
</script>
|
2022-09-22 16:16:04 +08:00
|
|
|
|
2022-11-28 13:50:53 +08:00
|
|
|
<style>
|
|
|
|
.topCard {
|
|
|
|
--el-card-border-color: var(--el-border-color-light);
|
|
|
|
--el-card-border-radius: 4px;
|
|
|
|
--el-card-padding: 0px;
|
|
|
|
--el-card-bg-color: var(--el-fill-color-blank);
|
|
|
|
}
|
|
|
|
.topButton .el-radio-button__inner {
|
|
|
|
display: inline-block;
|
|
|
|
line-height: 1;
|
|
|
|
white-space: nowrap;
|
|
|
|
vertical-align: middle;
|
|
|
|
background: var(--el-button-bg-color, var(--el-fill-color-blank));
|
|
|
|
border: 0;
|
|
|
|
font-weight: 350;
|
|
|
|
border-left: 0;
|
|
|
|
color: var(--el-button-text-color, var(--el-text-color-regular));
|
|
|
|
text-align: center;
|
|
|
|
box-sizing: border-box;
|
|
|
|
outline: 0;
|
|
|
|
margin: 0;
|
|
|
|
position: relative;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: var(--el-transition-all);
|
|
|
|
-webkit-user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
padding: 8px 15px;
|
|
|
|
font-size: var(--el-font-size-base);
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
</style>
|