mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-04 04:58:16 +08:00
00dc2add94
* feat: update prop type * feat: update ts type * feat: update ts type * feat: update ts type * feat: update ts type * test: update snap * feat: update ts type
27 lines
831 B
Vue
27 lines
831 B
Vue
import type { ExtractPropTypes } from 'vue';
|
|
import { defineComponent, computed } from 'vue';
|
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
|
|
|
export const cardGridProps = () => ({
|
|
prefixCls: String,
|
|
hoverable: { type: Boolean, default: true },
|
|
});
|
|
export type CardGridProps = Partial<ExtractPropTypes<ReturnType<typeof cardGridProps>>>;
|
|
export default defineComponent({
|
|
name: 'ACardGrid',
|
|
__ANT_CARD_GRID: true,
|
|
props: cardGridProps(),
|
|
setup(props, { slots }) {
|
|
const { prefixCls } = useConfigInject('card', props);
|
|
const classNames = computed(() => {
|
|
return {
|
|
[`${prefixCls.value}-grid`]: true,
|
|
[`${prefixCls.value}-grid-hoverable`]: props.hoverable,
|
|
};
|
|
});
|
|
return () => {
|
|
return <div class={classNames.value}>{slots.default?.()}</div>;
|
|
};
|
|
},
|
|
});
|