seer-dynamic-component
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -65,3 +65,3 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
value: function () { | ||
var _loadComponent = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(id) { | ||
var _loadComponent = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(id, relativePath) { | ||
var _this2 = this; | ||
@@ -75,3 +75,3 @@ | ||
_context2.next = 2; | ||
return getCompInfo(id); | ||
return getCompInfo(id, relativePath); | ||
@@ -103,3 +103,3 @@ case 2: | ||
_context.next = 3; | ||
return loadRealComponent(targetComp, id, "components_"); | ||
return loadRealComponent(targetComp, id, "components_", relativePath); | ||
@@ -154,3 +154,3 @@ case 3: | ||
function loadComponent(_x) { | ||
function loadComponent(_x, _x2) { | ||
return _loadComponent.apply(this, arguments); | ||
@@ -194,3 +194,3 @@ } | ||
function injectReducer(_x2, _x3, _x4) { | ||
function injectReducer(_x3, _x4, _x5) { | ||
return _injectReducer2.apply(this, arguments); | ||
@@ -204,4 +204,7 @@ } | ||
value: function componentDidMount() { | ||
var id = this.props.id; | ||
if (id) this.loadComponent(id); | ||
var _this$props = this.props, | ||
id = _this$props.id, | ||
_this$props$relativeP = _this$props.relativePath, | ||
relativePath = _this$props$relativeP === void 0 ? "/" : _this$props$relativeP; | ||
if (id) this.loadComponent(id, relativePath); | ||
} | ||
@@ -208,0 +211,0 @@ }, { |
@@ -10,4 +10,5 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
* @param {*} id | ||
* @param {*} relativePath | ||
*/ | ||
export var getCompInfo = function getCompInfo(id) { | ||
export var getCompInfo = function getCompInfo(id, relativePath) { | ||
return new Promise(function (resolve, reject) { | ||
@@ -24,3 +25,3 @@ window.seerConfig.components = window.seerConfig.components || []; | ||
return new Promise(function (resolve, reject) { | ||
window.System["import"]("/".concat(module, "/config.js?v=").concat(new Date().getTime())).then(function (res) { | ||
window.System["import"]("".concat(relativePath + module, "/config.js?v=").concat(new Date().getTime())).then(function (res) { | ||
delete window["default"]; | ||
@@ -67,2 +68,3 @@ | ||
* @param {*} key 当前查询的key值 componentsIn moduleIns | ||
* @param {*} relativePath 支持移动端app | ||
*/ | ||
@@ -72,2 +74,3 @@ | ||
var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "componentsIn"; | ||
var relativePath = arguments.length > 4 ? arguments[4] : undefined; | ||
return new Promise(function (resolve, reject) { | ||
@@ -87,3 +90,3 @@ var tranCompId = fp + compId.replace(/\./g, "_"); | ||
} else { | ||
window.System["import"]("/".concat(module, "/js/").concat(jsName)).then(function (res) { | ||
window.System["import"]("".concat(relativePath + module, "/js/").concat(jsName)).then(function (res) { | ||
delete window["default"]; | ||
@@ -90,0 +93,0 @@ window.seerConfig[key][module] = res["default"]; |
{ | ||
"name": "seer-dynamic-component", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15717
269
1