ant-design-vue/components/image/PreviewGroup.tsx

27 lines
851 B
Vue
Raw Normal View History

import PreviewGroup from '../vc-image/src/PreviewGroup';
2021-06-19 22:13:13 +08:00
import { computed, defineComponent, inject } from 'vue';
import { defaultConfigProvider } from '../config-provider';
import PropTypes from '../_util/vue-types';
const InternalPreviewGroup = defineComponent({
name: 'AImagePreviewGroup',
inheritAttrs: false,
props: { previewPrefixCls: PropTypes.string },
setup(props, { attrs, slots }) {
const configProvider = inject('configProvider', defaultConfigProvider);
2021-06-19 22:13:13 +08:00
const prefixCls = computed(() =>
configProvider.getPrefixCls('image-preview', props.previewPrefixCls),
);
return () => {
return (
<PreviewGroup
{...{ ...attrs, ...props }}
2021-06-19 22:13:13 +08:00
previewPrefixCls={prefixCls.value}
v-slots={slots}
></PreviewGroup>
);
};
},
});
export default InternalPreviewGroup;