@pisell/core 1.0.19 → 1.0.21

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.
@@ -301,13 +301,10 @@ export var Application = /*#__PURE__*/function () {
301
301
  key: "setComponent",
302
302
  value: function setComponent(code, component) {
303
303
  var _this4 = this;
304
- var Component = function Component() {
304
+ var Component = function Component(props) {
305
305
  var _ref4 = useRef();
306
306
  var Com = component === null || component === void 0 ? void 0 : component.Component;
307
- for (var _len = arguments.length, result = new Array(_len), _key = 0; _key < _len; _key++) {
308
- result[_key] = arguments[_key];
309
- }
310
- return /*#__PURE__*/React.createElement(Com, _extends({}, result, {
307
+ return /*#__PURE__*/React.createElement(Com, _extends({}, props, {
311
308
  ref: function ref(_ref) {
312
309
  _ref4.current = _ref;
313
310
  console.log('组件ref执行了');
@@ -318,7 +315,7 @@ export var Application = /*#__PURE__*/function () {
318
315
  }));
319
316
  };
320
317
  this.components.set(code, _objectSpread(_objectSpread({}, component), {}, {
321
- Component: Component
318
+ Component: component.autoRender ? Component : component.Component
322
319
  }));
323
320
  }
324
321
 
@@ -386,8 +383,8 @@ export var Application = /*#__PURE__*/function () {
386
383
  var _params = _objectSpread({
387
384
  app: this.app
388
385
  }, params);
389
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
390
- args[_key2 - 2] = arguments[_key2];
386
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
387
+ args[_key - 2] = arguments[_key];
391
388
  }
392
389
  return (_this$getFunction = this.getFunction(code)) === null || _this$getFunction === void 0 ? void 0 : _this$getFunction.code.apply(_this$getFunction, [_params].concat(args));
393
390
  }
@@ -170,13 +170,13 @@ var Application = class {
170
170
  * @returns {void}
171
171
  */
172
172
  setComponent(code, component) {
173
- const Component = (...result) => {
173
+ const Component = (props) => {
174
174
  const ref = (0, import_react.useRef)();
175
175
  const Com = component == null ? void 0 : component.Component;
176
176
  return /* @__PURE__ */ import_react.default.createElement(
177
177
  Com,
178
178
  {
179
- ...result,
179
+ ...props,
180
180
  ref: (_ref) => {
181
181
  ref.current = _ref;
182
182
  console.log("组件ref执行了");
@@ -190,7 +190,7 @@ var Application = class {
190
190
  };
191
191
  this.components.set(code, {
192
192
  ...component,
193
- Component
193
+ Component: component.autoRender ? Component : component.Component
194
194
  });
195
195
  }
196
196
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/core",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",