2021-10-07 09:23:36 +08:00
|
|
|
import { defineComponent, computed } from 'vue';
|
|
|
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
2018-01-20 14:33:42 +08:00
|
|
|
|
2020-10-12 19:19:10 +08:00
|
|
|
export default defineComponent({
|
2018-04-08 21:17:20 +08:00
|
|
|
name: 'ACardGrid',
|
2018-09-05 21:28:54 +08:00
|
|
|
__ANT_CARD_GRID: true,
|
2018-01-20 14:33:42 +08:00
|
|
|
props: {
|
2021-10-07 09:23:36 +08:00
|
|
|
prefixCls: String,
|
|
|
|
hoverable: { type: Boolean, default: true },
|
2018-01-20 14:33:42 +08:00
|
|
|
},
|
2021-10-07 09:23:36 +08:00
|
|
|
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>;
|
2020-06-22 23:22:52 +08:00
|
|
|
};
|
2019-03-13 21:32:14 +08:00
|
|
|
},
|
2020-10-12 19:19:10 +08:00
|
|
|
});
|