如何减少Ionic Cordova项目启动持续时间? [英] How can I decrease the Ionic Cordova Project Start duration ?

查看:436
本文介绍了如何减少Ionic Cordova项目启动持续时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个离子cordova项目但是在发布到android手机之后。根据手机类型,我们的计划持续时间约为10-20秒。

I made a ionic cordova project but after publishing to android mobile phone. The duration of our program is around 10-20 sec with respec to the mobile phone types.

当我搜索此问题时,人们会说这是因为

When I search this problem, people say that it is because of


  1. 启动画面持续时间(没有加载离子闪屏 Ionic2性能问题

  2. 任何图像的路径问题

  3. 第三方库

  4. 外部CDN脚本库

  5. 懒惰加载页面

  1. Splash Screen duration (Ionic splash screen not loading and Ionic2 performance issue)
  2. Path problem of any image
  3. 3rd Party libraries
  4. External CDN script libraries
  5. Lazy loading of pages

我尝试解决上述问题,例如我删除了第三方库或基于CDN的脚本并检查所有图像路径等。

I try to solve regarding above problems e.g. i removed 3rd party libraries or CDN based scripts and check the all image paths etc..

我认为Ionic是移动编程的错误选择。

I think Ionic is a wrong choice for mobile programming.

有没有减少移动应用程序开放时间的解决方案?

Is there any solution to decrease the opening duration of my mobile application ?

谢谢

推荐答案

所有其他答案也是必要的,但我想补充一点意见。

The all other answers are also necessary but I want to add another opinion.

如果您使用IONIC 3,您可以尝试延迟加载并丢弃不必要的第三方库,如真棒或其他...

If u use IONIC 3 you can try lazy loading and discard unnecessary 3rd party libraries like awesome or another...

Ionic 3的这一新功能不仅使我们的代码更加简洁,而且避免了在每个类中以相同路径键入每个该死的时间的麻烦!
延迟加载允许我们只使用字符串访问我们想要的页面。

This new feature from Ionic 3 not only makes our code more concise but also avoid the hassle of typing every damn time the same paths in every Class! Lazy Loading allows us to access Pages wherever we want by only using a string.

在旧版本中,你需要使用

In old version, u need to use

import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';

@NgModule({
  declarations: [
    MyApp,
    AboutPage,
    ContactPage,
    HomePage,
    TabsPage
  ],
  .
  .
  .
  entryComponents: [
    MyApp,
    AboutPage,
    ContactPage,
    HomePage,
    TabsPage
  ]
})

在Ionic 3你不要需要导入这些类。你可以使用离子g页面示例然后我们看到一个 @IonicPage 装饰器和一个同名的模块目录。

In Ionic 3 u dont need to import these classes. U can use ionic g page example Then we see that a @IonicPage decorator and a module with a same name in the directory.

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { Lazy } from './example';
@NgModule({
  declarations: [
    Example,
  ],
  imports: [
    IonicPageModule.forChild(example),
  ],
  exports: [
     Example
  ]
})
export class ExampleModule {}

启动程序时无法加载此页面或组件。

This pages or components could not be loaded while starting program.

这篇关于如何减少Ionic Cordova项目启动持续时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆