2022-08-17 17:46:49 +08:00
|
|
|
<template>
|
2022-09-27 16:57:23 +08:00
|
|
|
<div>
|
2022-09-22 16:16:04 +08:00
|
|
|
<el-row :gutter="20">
|
2022-09-26 16:32:40 +08:00
|
|
|
<el-col :span="24">
|
|
|
|
<div style="margin-bottom: 10px">
|
|
|
|
<el-radio-group v-model="activeName">
|
2022-09-27 16:57:23 +08:00
|
|
|
<el-radio-button label="all" @click="routerTo('/apps/all')">
|
2022-09-26 16:32:40 +08:00
|
|
|
{{ $t('app.all') }}
|
|
|
|
</el-radio-button>
|
2022-09-27 16:57:23 +08:00
|
|
|
<el-radio-button label="installed" @click="routerTo('/apps/installed')">
|
2022-09-26 16:32:40 +08:00
|
|
|
{{ $t('app.installed') }}
|
|
|
|
</el-radio-button>
|
|
|
|
</el-radio-group>
|
2022-09-22 16:16:04 +08:00
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
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-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
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.header {
|
|
|
|
padding-bottom: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.a-card {
|
|
|
|
height: 100px;
|
|
|
|
margin-top: 10px;
|
|
|
|
cursor: pointer;
|
|
|
|
padding: 1px;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
width: 100%;
|
|
|
|
height: 80%;
|
|
|
|
padding: 10%;
|
|
|
|
margin-top: 5px;
|
|
|
|
.image {
|
|
|
|
width: auto;
|
|
|
|
height: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.a-detail {
|
|
|
|
margin-top: 10px;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
.d-name {
|
|
|
|
height: 20%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.d-description {
|
|
|
|
overflow: hidden;
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.a-card:hover {
|
|
|
|
transform: scale(1.1);
|
|
|
|
}
|
|
|
|
</style>
|