1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-21 09:19:16 +08:00

37 lines
976 B
Vue
Raw Normal View History

2022-08-17 17:46:49 +08:00
<template>
2022-10-20 18:45:47 +08:00
<div>
2023-01-06 12:17:50 +08:00
<el-card class="topRouterCard">
<el-radio-group :model-value="props.activeName" @change="handleChange">
2023-01-06 12:17:50 +08:00
<el-radio-button class="topRouterButton" size="default" label="mysql">Mysql</el-radio-button>
<el-radio-button class="topRouterButton" size="default" label="redis">Redis</el-radio-button>
2022-10-20 18:45:47 +08:00
</el-radio-group>
</el-card>
</div>
2022-08-17 17:46:49 +08:00
</template>
<script lang="ts" setup>
2022-10-20 18:45:47 +08:00
import { useRouter } from 'vue-router';
const router = useRouter();
interface MenuProps {
activeName: string;
}
const props = withDefaults(defineProps<MenuProps>(), {
activeName: 'mysql',
});
const routerTo = (path: string) => {
router.push({ path: path });
};
const handleChange = (val: string) => {
switch (val) {
case 'mysql':
routerTo('/databases');
break;
case 'redis':
routerTo('/databases/redis');
break;
}
};
2022-08-17 17:46:49 +08:00
</script>