amis
Version:
一种MIS页面生成工具
21 lines (20 loc) • 822 B
JavaScript
;
/**
* @file 用于在移动端或不同语言环境下使用不同配置
*/
var _a, _b;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var factory_1 = require("./factory");
var isMobile = ((_b = (_a = window).matchMedia) === null || _b === void 0 ? void 0 : _b.call(_a, '(max-width: 768px)').matches) ? true
: false;
factory_1.addSchemaFilter(function (schema, renderer, props) {
if (schema.mobile && isMobile) {
return tslib_1.__assign(tslib_1.__assign({}, schema), schema.mobile);
}
if ((props === null || props === void 0 ? void 0 : props.locale) && schema[props.locale]) {
return tslib_1.__assign(tslib_1.__assign({}, schema), schema[props.locale]);
}
return schema;
});
//# sourceMappingURL=./envOverwrite.js.map