refactor: 修改为ts写法

This commit is contained in:
dap 2025-03-23 12:23:00 +08:00
parent 22ff5bddae
commit e546c21ad6
2 changed files with 9 additions and 21 deletions

View File

@ -1,6 +1,4 @@
<script setup lang="ts">
import type { PropType } from 'vue';
import type { RedisInfo } from '#/api/monitor/cache';
import type { DescItem } from '#/components/description';
@ -12,12 +10,7 @@ interface IRedisInfo extends RedisInfo {
dbSize: string;
}
const props = defineProps({
data: {
required: true,
type: Object as PropType<IRedisInfo>,
},
});
const props = defineProps<{ data: IRedisInfo }>();
const descSchemas: DescItem[] = [
{ field: 'redis_version', label: 'redis版本' },

View File

@ -2,7 +2,6 @@
import {
onBeforeUnmount,
onMounted,
type PropType,
shallowRef,
useTemplateRef,
watch,
@ -14,18 +13,14 @@ import Vditor from 'vditor';
import 'vditor/dist/index.css';
const props = defineProps({
//
height: {
// stringnumber
type: [String, Number],
default: 500,
},
//
options: {
type: Object as PropType<IOptions>,
default: () => ({}),
},
interface Props {
height?: number | string;
options?: IOptions;
}
const props = withDefaults(defineProps<Props>(), {
height: 500,
options: () => ({}),
});
const emit = defineEmits<{