帖子
帖子
用户
博客
课程
显示全部楼层
3
帖子
0
勋章
8
Y币
发表于 2020-5-5 15:20:46
2
未解决

请大佬帮忙看看,ios的启动页特别慢,差不多有10s才进去app [复制链接]

  • 发表于:2020-05-05 15:20:46
用的vue+apicloud_cli做的项目config.xml配置了<preference name="autoLaunch" value="false"/>


然后在app.vue的mounted里面加了api.removeLaunchView();  安卓就正常ios就特别慢


  • mounted() {
  •     // console.log(this.keepAlive); // 设置缓存匹配
  •     var that = this;
  •     if (window.navigator.userAgent.match(/APICloud/i)) {
  •       //关闭启动图
  •       api.removeLaunchView();
  •       that.$store.state.systemType = api.systemType;
  •       // api.setStatusBarStyle({
  •       //   style: "light",
  •       //   color: "rgba(255,255,255,0)"
  •       // });
  •       // that.allEvent();
  •       // this.$RONGYUN.initRongyun(); //初始化融云
  •       // 更新
  •       api.addEventListener(
  •         {
  •           name: "smartupdatefinish"
  •         },
  •         function(ret, err) {
  •           that.$dialog
  •             .confirm({
  •               title: "更新",
  •               message: "APP更新完成,是否现在重启?"
  •             })
  •             .then(() => {
  •               api.rebootApp();
  •             });
  •         }
  •       );
  •       // var push = api.require("push");
  •       // push.setListener(function(ret, err) {
  •       //   if (ret) {
  •       //     //仅提示音
  •       //     api.notification({
  •       //       sound: "default",
  •       //       notify: {
  •       //         title: "通知",
  •       //         content: ret.data
  •       //       }
  •       //     });
  •       //   }
  •       // });
  •     }
  •   },

复制代码


20
帖子
0
勋章
6613
Y币
mounted  里的都注释一下 试试
3
帖子
0
勋章
8
Y币
yxWin 发表于 2020-5-6 10:08
mounted  里的都注释一下 试试

只保留这个吗   api.removeLaunchView();
20
帖子
0
勋章
6613
Y币
method  都注释 运行慢吗?

试试写一个 空页面 运行 不写js 代码
3
帖子
0
勋章
8
Y币
yxWin 发表于 2020-5-8 16:44
method  都注释 运行慢吗?

试试写一个 空页面 运行 不写js 代码

都注释了,也慢,我写个空页面试试
20
帖子
0
勋章
6613
Y币
空页面呢?  别加载 vuejs  你是不是有字体啊?
3
帖子
0
勋章
8
Y币
对的对的,有外部字体,三个文件都挺大的
您需要登录后才可以回帖 登录

本版积分规则