fix(editor): Fix design system typecheck errors (no-changelog) (#9447)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { InputSize } from '@/types';
|
||||
import type { ElementPlusSizePropType, InputSize } from '@/types';
|
||||
import { ElInputNumber } from 'element-plus';
|
||||
import { computed } from 'vue';
|
||||
|
||||
type InputNumberProps = {
|
||||
size?: InputSize;
|
||||
@@ -10,9 +11,24 @@ type InputNumberProps = {
|
||||
precision?: number;
|
||||
};
|
||||
|
||||
defineProps<InputNumberProps>();
|
||||
const props = withDefaults(defineProps<InputNumberProps>(), {
|
||||
size: undefined,
|
||||
step: 1,
|
||||
precision: 0,
|
||||
min: -Infinity,
|
||||
max: Infinity,
|
||||
});
|
||||
|
||||
const resolvedSize = computed(() => props.size as ElementPlusSizePropType);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElInputNumber v-bind="{ ...$props, ...$attrs }" />
|
||||
<ElInputNumber
|
||||
:size="resolvedSize"
|
||||
:min="min"
|
||||
:max="max"
|
||||
:step="step"
|
||||
:precision="precision"
|
||||
v-bind="$attrs"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user