You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
863 B
31 lines
863 B
import { defineComponent, inject } from 'vue';
|
|
import PropTypes from '../_util/vue-types';
|
|
import { defaultConfigProvider } from '../config-provider';
|
|
import { getSlot } from '../_util/props-util';
|
|
|
|
export default defineComponent({
|
|
name: 'ACardGrid',
|
|
__ANT_CARD_GRID: true,
|
|
props: {
|
|
prefixCls: PropTypes.string,
|
|
hoverable: PropTypes.looseBool,
|
|
},
|
|
setup() {
|
|
return {
|
|
configProvider: inject('configProvider', defaultConfigProvider),
|
|
};
|
|
},
|
|
render() {
|
|
const { prefixCls: customizePrefixCls, hoverable = true } = this.$props;
|
|
|
|
const { getPrefixCls } = this.configProvider;
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
|
|
const classString = {
|
|
[`${prefixCls}-grid`]: true,
|
|
[`${prefixCls}-grid-hoverable`]: hoverable,
|
|
};
|
|
return <div class={classString}>{getSlot(this)}</div>;
|
|
},
|
|
});
|