1
0
mirror of synced 2026-04-05 07:48:35 +08:00

feat(design): 新增TMagicDesign,用于适配不同的ui框架

#401
This commit is contained in:
roymondchen
2022-10-11 15:21:18 +08:00
committed by jia000
parent e3b7f587ee
commit e2d784176b
40 changed files with 1288 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<template>
<component
:is="uiComponent.component"
v-bind="uiProps"
@change="changeHandler"
@input="inputHandler"
@update:modelValue="updateModelValue"
></component>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { getConfig } from './config';
const props = defineProps<{
modelValue?: string | number | boolean;
clearable?: boolean;
controlsPosition?: string;
disabled?: boolean;
placeholder?: string;
step?: number;
min?: number;
max?: number;
size?: 'mini' | 'small' | 'medium';
}>();
const uiComponent = getConfig('components').inputNumber;
const uiProps = computed(() => uiComponent.props(props));
const emit = defineEmits(['change', 'input', 'update:modelValue']);
const changeHandler = (...args: any[]) => {
emit('change', ...args);
};
const inputHandler = (...args: any[]) => {
emit('input', ...args);
};
const updateModelValue = (...args: any[]) => {
emit('update:modelValue', ...args);
};
</script>