tdesign-mobile-vue
Version:
tdesign-mobile-vue
68 lines (64 loc) • 1.98 kB
JavaScript
/**
* tdesign v1.7.0
* (c) 2024 TDesign Group
* @license MIT
*/
import { defineComponent, computed, provide, createVNode } from 'vue';
import props from './row-props.js';
import config from '../config.js';
import { rowInjectionKey } from './constants.js';
import { useTNodeJSX } from '../hooks/tnode.js';
import { usePrefixClass } from '../hooks/useClass.js';
import { convertUnit } from '../shared/util.js';
import 'lodash/isFunction';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../hooks/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/isString';
import 'lodash/isObject';
import '../config-provider/useConfig.js';
import '@babel/runtime/helpers/defineProperty';
import 'lodash/cloneDeep';
import '../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
import '../_common/js/global-config/mobile/default-config.js';
import '../_common/js/global-config/mobile/locale/zh_CN.js';
import '../_chunks/dep-d5364bc4.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-eb734424.js';
import 'dayjs';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/isNumber';
var prefix = config.prefix;
var _Row = defineComponent({
name: "".concat(prefix, "-row"),
props: props,
setup: function setup(props2) {
var renderTNodeJSX = useTNodeJSX();
var rowClass = usePrefixClass("row");
var style = computed(function () {
var styles = {};
if (!props2.gutter) {
return styles;
}
var gutterVal = convertUnit(-props2.gutter / 2);
styles.marginRight = gutterVal;
styles.marginLeft = gutterVal;
return styles;
});
provide(rowInjectionKey, {
gutter: props2.gutter || 0
});
return function () {
return createVNode("div", {
"class": rowClass.value,
"style": style.value
}, [renderTNodeJSX("default")]);
};
}
});
export { _Row as default };
//# sourceMappingURL=row.js.map