mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
29 lines
644 B
Vue
29 lines
644 B
Vue
<template>
|
|
<component class="tmagic-design-popover" :is="uiComponent" v-bind="uiProps">
|
|
<slot></slot>
|
|
|
|
<template #reference>
|
|
<slot name="reference"></slot>
|
|
</template>
|
|
</component>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
|
|
import { getConfig } from './config';
|
|
import type { PopoverProps } from './types';
|
|
|
|
defineOptions({
|
|
name: 'TMPopover',
|
|
});
|
|
|
|
const props = withDefaults(defineProps<PopoverProps>(), { visible: null });
|
|
|
|
const ui = getConfig('components')?.popover;
|
|
|
|
const uiComponent = ui?.component || 'el-popover';
|
|
|
|
const uiProps = computed(() => ui?.props(props) || props);
|
|
</script>
|