mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 01:11:53 +08:00
31 lines
829 B
Vue
31 lines
829 B
Vue
import { inject } from 'vue';
|
|
import PropTypes from '../_util/vue-types';
|
|
import { ConfigConsumerProps } from '../config-provider';
|
|
import { getSlot } from '../_util/props-util';
|
|
|
|
export default {
|
|
name: 'ACardGrid',
|
|
__ANT_CARD_GRID: true,
|
|
props: {
|
|
prefixCls: PropTypes.string,
|
|
hoverable: PropTypes.bool,
|
|
},
|
|
setup() {
|
|
return {
|
|
configProvider: inject('configProvider', ConfigConsumerProps),
|
|
};
|
|
},
|
|
render() {
|
|
const { prefixCls: customizePrefixCls, hoverable = true } = this.$props;
|
|
|
|
const getPrefixCls = this.configProvider.getPrefixCls;
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
|
|
const classString = {
|
|
[`${prefixCls}-grid`]: true,
|
|
[`${prefixCls}-grid-hoverable`]: hoverable,
|
|
};
|
|
return <div class={classString}>{getSlot(this)}</div>;
|
|
},
|
|
};
|