mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-05 19:41:40 +08:00
31 lines
643 B
Vue
31 lines
643 B
Vue
<template>
|
|
<component class="tmagic-design-step" :is="uiComponent" v-bind="uiProps" @click="clickHandler">
|
|
<slot></slot>
|
|
</component>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
|
|
import { getConfig } from './config';
|
|
import type { StepProps } from './types';
|
|
|
|
defineOptions({
|
|
name: 'TMStep',
|
|
});
|
|
|
|
const props = defineProps<StepProps>();
|
|
|
|
const emit = defineEmits(['click']);
|
|
|
|
const clickHandler = (...args: any[]) => {
|
|
emit('click', ...args);
|
|
};
|
|
|
|
const ui = getConfig('components')?.step;
|
|
|
|
const uiComponent = ui?.component || 'el-step';
|
|
|
|
const uiProps = computed(() => ui?.props(props) || {});
|
|
</script>
|