ant-design-vue/components/card/Grid.tsx
tangjinzhou 75cf264040
refactor: tabs & card (#4732)
* refactor: tabs

* refactor: tabs

* fix: tabs hotreload error

* refactor: rename useRef

* feat: add leftExtra rightExtra

* refactor: tabs

* test: update tabs test

* refactor: card

* doc: update tabs demo

* refactor: add card style

* style: update vue dep
2021-10-07 09:23:36 +08:00

24 lines
649 B
Vue

import { defineComponent, computed } from 'vue';
import useConfigInject from '../_util/hooks/useConfigInject';
export default defineComponent({
name: 'ACardGrid',
__ANT_CARD_GRID: true,
props: {
prefixCls: String,
hoverable: { type: Boolean, default: true },
},
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>;
};
},
});