UNPKG

@morjs/runtime-web

Version:
31 lines 935 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const CAN_I_USE_FALSY = [ 'component.observers', 'component.relations', 'component.externalClass', 'component.lifetimes' ]; function generateBaseAPI(api) { return { call(apiName, params, success, fail, complete) { if (typeof api[apiName] !== 'function') return void console.warn(`my.call('${apiName}') 暂未实现`); api[apiName]({ params, success, fail, complete }); }, canIUse(param = '') { console.warn('canIUse API 目前还未完全实现,仅供参考'); if (CAN_I_USE_FALSY.indexOf(param) > -1) return false; return true; }, SDKVersion: '1.0.0' }; } exports.default = generateBaseAPI; //# sourceMappingURL=base.js.map