2019-01-12 11:33:27 +08:00
|
|
|
import PropTypes from '../_util/vue-types';
|
2019-03-13 21:32:14 +08:00
|
|
|
import { ConfigConsumerProps } from '../config-provider';
|
2018-01-20 14:33:42 +08:00
|
|
|
|
|
|
|
export default {
|
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: {
|
|
|
|
prefixCls: PropTypes.string.def('ant-card'),
|
|
|
|
},
|
2019-03-13 21:32:14 +08:00
|
|
|
inject: {
|
|
|
|
configProvider: { default: () => ({}) },
|
|
|
|
},
|
2019-01-12 11:33:27 +08:00
|
|
|
render() {
|
2019-03-13 21:32:14 +08:00
|
|
|
const { prefixCls: customizePrefixCls } = this.$props;
|
|
|
|
|
|
|
|
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
|
|
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
|
|
|
2018-01-20 14:33:42 +08:00
|
|
|
const classString = {
|
|
|
|
[`${prefixCls}-grid`]: true,
|
2019-01-12 11:33:27 +08:00
|
|
|
};
|
2018-01-20 14:33:42 +08:00
|
|
|
return (
|
2019-01-12 11:33:27 +08:00
|
|
|
<div {...{ on: this.$listeners }} class={classString}>
|
|
|
|
{this.$slots.default}
|
|
|
|
</div>
|
|
|
|
);
|
2018-01-20 14:33:42 +08:00
|
|
|
},
|
2019-01-12 11:33:27 +08:00
|
|
|
};
|