UNPKG

mobile-more

Version:

基于 antd-mobile v5 扩展移动端 UI 组件

40 lines (37 loc) 1.42 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["value", "split", "wrapperStyle", "wrapperClassName"]; import 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, _extends({ value: item }, restProps)), index !== value.length - 1 && split); })); } return /*#__PURE__*/React.createElement(BaseDictionary, _extends({ value: value }, restProps)); }; /** * @deprecated 即将废弃,请使用 `BizDictionary` 替代。 */ export var Dictionary = BizDictionary; /** * @deprecated 即将废弃,请使用 `BizDictionaryProps` 替代。 */ export default BizDictionary;