mobile-more
Version:
基于 antd-mobile v5 扩展移动端 UI 组件
34 lines • 1.36 kB
JavaScript
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["value", "split", "wrapperStyle", "wrapperClassName"];
import * as React from 'react';
import BaseDictionary from './BaseDictionary';
import { isArray, toString } from 'ut2';
var BizDictionary = function BizDictionary(_ref) {
var value = _ref.value,
_ref$split = _ref.split,
split = _ref$split === void 0 ? '、' : _ref$split,
wrapperStyle = _ref.wrapperStyle,
wrapperClassName = _ref.wrapperClassName,
restProps = _objectWithoutProperties(_ref, _excluded);
if (isArray(value)) {
return /*#__PURE__*/React.createElement("div", {
style: wrapperStyle,
className: wrapperClassName
}, value.map(function (item, index) {
return /*#__PURE__*/React.createElement(React.Fragment, {
key: toString(item) + index
}, /*#__PURE__*/React.createElement(BaseDictionary, _objectSpread({
value: item
}, restProps)), index !== value.length - 1 && split);
}));
}
return /*#__PURE__*/React.createElement(BaseDictionary, _objectSpread({
value: value
}, restProps));
};
/**
* @deprecated 即将废弃,请使用 `BizDictionary` 替代。
*/
export var Dictionary = BizDictionary;
export default BizDictionary;