2022-08-17 17:46:49 +08:00
|
|
|
<template>
|
2022-09-27 16:57:23 +08:00
|
|
|
<div>
|
2023-01-06 12:17:50 +08:00
|
|
|
<el-card class="topRouterCard">
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-group v-model="activeName" @change="handleChange">
|
2023-01-06 12:17:50 +08:00
|
|
|
<el-radio-button class="topRouterButton" size="default" label="all">
|
2022-11-28 13:50:53 +08:00
|
|
|
{{ $t('app.all') }}
|
|
|
|
</el-radio-button>
|
2023-01-06 12:17:50 +08:00
|
|
|
<el-radio-button class="topRouterButton" size="default" label="installed">
|
2022-11-28 13:50:53 +08:00
|
|
|
{{ $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
|
|
|
|
2022-12-28 11:54:26 +08:00
|
|
|
const handleChange = (val: string) => {
|
|
|
|
switch (val) {
|
|
|
|
case 'all':
|
|
|
|
routerTo('/apps/all');
|
|
|
|
break;
|
|
|
|
case 'installed':
|
|
|
|
routerTo('/apps/installed');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
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>
|