fastlion-amis
Version:
一种MIS页面生成工具
34 lines (33 loc) • 1.25 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpenPageAction = void 0;
var tslib_1 = require("tslib");
var tpl_1 = require("../utils/tpl");
var Action_1 = require("./Action");
/**
* 打开页面动作
*
* @export
* @class OpenPageAction
* @implements {Action}
*/
var OpenPageAction = /** @class */ (function () {
function OpenPageAction() {
}
OpenPageAction.prototype.run = function (action, renderer, event) {
var _a;
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
return (0, tslib_1.__generator)(this, function (_b) {
if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.jumpTo)) {
throw new Error('env.jumpTo is required!');
}
renderer.props.env.jumpTo((0, tpl_1.filter)((action.to || action.url || action.link), action.args, '| raw'), action, action.args);
return [2 /*return*/];
});
});
};
return OpenPageAction;
}());
exports.OpenPageAction = OpenPageAction;
(0, Action_1.registerAction)('openpage', new OpenPageAction());
//# sourceMappingURL=./actions/OpenPageAction.js.map
;