企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
apicloud $api前端框架文档地址: [https://docs.apicloud.com/Front-end-Framework/framework-dev-guide](https://docs.apicloud.com/Front-end-Framework/framework-dev-guide) ## 使用前先引入文件 ``` import ea55api_vue from 'ea55api_vue'; ``` ``` //调用 let $api=ea55api_vue.lib('api'); ``` ## 使用方法跟上面文档一样 ### 比如说get请求 ``` let $api=ea55api_vue.lib('api'); $api.get('http://www.pm25.in/api/querys/pm2_5.json?city=beijing&token=5j1znBVAsnSf5xQyNQyq',function(ret){ alert(ret); },'text'); ``` ### 比如说调整顶部标题栏自适应 ``` let $api=ea55api_vue.lib('api'); var header = document.getElementById('header'); if (header) { $api.fixStatusBar(header); } ``` ### 更完整的例子 在h5页面直接使用apicloud $api方法 调整自适应头部。 ``` setup() { ea55api_vue.ready(function() { switch (ea55api_vue.environ()) { case 'apicloud': let $api = ea55api_vue.lib('api'); var header = document.getElementById('header'); if (header) { $api.fixStatusBar(header); } break; default: } }) return { } } ```