refactor: 修改为ts写法
This commit is contained in:
parent
22ff5bddae
commit
e546c21ad6
@ -1,6 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from 'vue';
|
|
||||||
|
|
||||||
import type { RedisInfo } from '#/api/monitor/cache';
|
import type { RedisInfo } from '#/api/monitor/cache';
|
||||||
import type { DescItem } from '#/components/description';
|
import type { DescItem } from '#/components/description';
|
||||||
|
|
||||||
@ -12,12 +10,7 @@ interface IRedisInfo extends RedisInfo {
|
|||||||
dbSize: string;
|
dbSize: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{ data: IRedisInfo }>();
|
||||||
data: {
|
|
||||||
required: true,
|
|
||||||
type: Object as PropType<IRedisInfo>,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const descSchemas: DescItem[] = [
|
const descSchemas: DescItem[] = [
|
||||||
{ field: 'redis_version', label: 'redis版本' },
|
{ field: 'redis_version', label: 'redis版本' },
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import {
|
import {
|
||||||
onBeforeUnmount,
|
onBeforeUnmount,
|
||||||
onMounted,
|
onMounted,
|
||||||
type PropType,
|
|
||||||
shallowRef,
|
shallowRef,
|
||||||
useTemplateRef,
|
useTemplateRef,
|
||||||
watch,
|
watch,
|
||||||
@ -14,18 +13,14 @@ import Vditor from 'vditor';
|
|||||||
|
|
||||||
import 'vditor/dist/index.css';
|
import 'vditor/dist/index.css';
|
||||||
|
|
||||||
const props = defineProps({
|
interface Props {
|
||||||
// 编辑器高度
|
height?: number | string;
|
||||||
height: {
|
options?: IOptions;
|
||||||
// string或者number类型
|
}
|
||||||
type: [String, Number],
|
|
||||||
default: 500,
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
},
|
height: 500,
|
||||||
// 其他配置项
|
options: () => ({}),
|
||||||
options: {
|
|
||||||
type: Object as PropType<IOptions>,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
Loading…
Reference in New Issue
Block a user