UNPKG

vue-ant-patterns

Version:

vue-ant-patterns

56 lines (51 loc) 2.09 kB
import _defineProperty from 'babel-runtime/helpers/defineProperty'; import _extends from 'babel-runtime/helpers/extends'; import PropTypes from 'ant-design-vue/es/_util/vue-types'; import { styleUnitExtract } from '../_utils'; import cx from 'classnames'; import BasiProps from './BasicProps'; import createClass from './createCls'; var Basic = { props: _extends({}, BasiProps(), { prefixCls: String }), render: function render(h) { var _cx; var _$props = this.$props, prefixCls = _$props.prefixCls, tagName = _$props.tagName, align = _$props.align, justify = _$props.justify, grow = _$props.grow, flex = _$props.flex, wrap = _$props.wrap, margin = _$props.margin, padding = _$props.padding, width = _$props.width, height = _$props.height, viewPage = _$props.viewPage, scroll = _$props.scroll; var $slots = this.$slots, $attrs = this.$attrs, $listeners = this.$listeners; var isX = scroll.includes('x'); var isY = scroll.includes('y'); var cls = cx((_cx = {}, _defineProperty(_cx, prefixCls, 1), _defineProperty(_cx, createClass('align', align), 1), _defineProperty(_cx, createClass('justify', justify), 1), _defineProperty(_cx, 'depot-container-grow', grow), _defineProperty(_cx, 'depot-container-flex', flex), _defineProperty(_cx, 'depot-container-wrap', wrap), _defineProperty(_cx, 'depot-container-view-page', viewPage), _defineProperty(_cx, 'depot-container-scroll-x', isX), _defineProperty(_cx, 'depot-container-scroll-y', isY), _cx)); var divProps = { 'class': cls, on: $listeners, style: { padding: padding, margin: margin, width: styleUnitExtract(width), height: styleUnitExtract(height) } }; // if (tagName !== 'div') { // return h(tagName, { ...divProps }, $slots.default); // } // return <div {...divProps}>{$slots.default}</div>; return h(tagName, _extends({}, divProps, $attrs), $slots['default']); } }; export default Basic;