Grid.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props';
  2. import _defineProperty from 'babel-runtime/helpers/defineProperty';
  3. import PropTypes from '../_util/vue-types';
  4. import { ConfigConsumerProps } from '../config-provider/configConsumerProps';
  5. import { getListeners } from '../_util/props-util';
  6. export default {
  7. name: 'ACardGrid',
  8. __ANT_CARD_GRID: true,
  9. props: {
  10. prefixCls: PropTypes.string,
  11. hoverable: PropTypes.bool
  12. },
  13. inject: {
  14. configProvider: { 'default': function _default() {
  15. return ConfigConsumerProps;
  16. } }
  17. },
  18. render: function render() {
  19. var _classString;
  20. var h = arguments[0];
  21. var _$props = this.$props,
  22. customizePrefixCls = _$props.prefixCls,
  23. _$props$hoverable = _$props.hoverable,
  24. hoverable = _$props$hoverable === undefined ? true : _$props$hoverable;
  25. var getPrefixCls = this.configProvider.getPrefixCls;
  26. var prefixCls = getPrefixCls('card', customizePrefixCls);
  27. var classString = (_classString = {}, _defineProperty(_classString, prefixCls + '-grid', true), _defineProperty(_classString, prefixCls + '-grid-hoverable', hoverable), _classString);
  28. return h(
  29. 'div',
  30. _mergeJSXProps([{ on: getListeners(this) }, { 'class': classString }]),
  31. [this.$slots['default']]
  32. );
  33. }
  34. };