@zgfe/business-lib 1.2.51-plat.0 → 1.2.51-plat.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,10 +10,7 @@ declare const BizPlatformSelector: React.FC<{
10
10
  key: number;
11
11
  value: string;
12
12
  };
13
- value?: {
14
- key: number;
15
- value: string;
16
- };
13
+ value?: number;
17
14
  valueOption?: platItemProp[];
18
15
  }>;
19
16
  export default BizPlatformSelector;
@@ -10,13 +10,18 @@ import { platformOption } from './util';
10
10
  import './styles/index.less';
11
11
  var BizPlatformSelector = function BizPlatformSelector(props) {
12
12
  var classPrefix = 'biz-platform-selector';
13
- var _useState = useState(),
13
+ var _useState = useState(0),
14
14
  _useState2 = _slicedToArray(_useState, 2),
15
15
  currentValue = _useState2[0],
16
16
  setCurrentValue = _useState2[1];
17
17
  useEffect(function () {
18
- console.log('props-value', props.value);
19
- setCurrentValue(props.value);
18
+ if (props.value) {
19
+ var selectValue = platformOption.find(function (item) {
20
+ return item.key === props.value;
21
+ });
22
+ console.log('selectValue', selectValue);
23
+ setCurrentValue((selectValue === null || selectValue === void 0 ? void 0 : selectValue.key) || 0);
24
+ }
20
25
  }, [props.value]);
21
26
  return /*#__PURE__*/React.createElement("div", {
22
27
  className: classPrefix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.51-plat.0",
3
+ "version": "1.2.51-plat.2",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "react": "^16.12.0 || ^17.0.0",
56
56
  "yorkie": "^2.0.0"
57
57
  },
58
- "gitHead": "9754b25ed99633fd6b49b84307065bd28e482e7a",
58
+ "gitHead": "2415a78f6240b5bce5248e8db6522d175f9bc374",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }