mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-23 02:15:10 +08:00
31 lines
686 B
Vue
31 lines
686 B
Vue
<template>
|
|
<component :is="uiComponent.component" v-bind="uiProps" @update:modelValue="updateModelValue" @change="changeHandler">
|
|
<slot></slot>
|
|
</component>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
|
|
import { getConfig } from './config';
|
|
|
|
const props = defineProps<{
|
|
modelValue?: string | string[];
|
|
accordion?: boolean;
|
|
}>();
|
|
|
|
const uiComponent = getConfig('components').collapse;
|
|
|
|
const uiProps = computed(() => uiComponent.props(props));
|
|
|
|
const emit = defineEmits(['change', 'update:modelValue']);
|
|
|
|
const changeHandler = (v: any) => {
|
|
emit('change', v);
|
|
};
|
|
|
|
const updateModelValue = (v: any) => {
|
|
emit('update:modelValue', v);
|
|
};
|
|
</script>
|