Skip to main content

启动应用

启动一个新的 Ionic 应用非常简单。从命令行运行 ionic start 命令,CLI 将处理其余的事情。

¥Starting a new Ionic app is incredibly simple. From the command line, run the ionic start command and the CLI will handle the rest.

$ ionic start

Every great app needs a name! 😍

Please enter the full name of your app. You can change this at any time.
To bypass this prompt next time, supply name,
the first argument to ionic start.

? Project name: █

Ionic CLI 将显示提示,询问新项目的名称以及要使用的模板。这些详细信息可以作为命令参数提供:

¥The Ionic CLI will display prompts asking for the new project's name and which template to use. These details can be provided as command arguments:

$ ionic start myApp tabs

其中,myApp 是项目名称,tabs 是入门模板,项目类型是 angular

¥Here, myApp is the name of the project, tabs is the starter template, and the project type is angular.

tabs 不是唯一可用的项目模板。在所有项目类型之间,共有三种可用模板:

¥tabs is not the only project template available. Between all project types, there are three templates available:

  • tabs:基于选项卡的布局

    ¥tabs: A tabs based layout

  • sidemenu:基于侧菜单的布局

    ¥sidemenu: A sidemenu based layout

  • blank:具有单页的空项目

    ¥blank: An empty project with a single page

使用以下命令查看所有可用模板:

¥See all available templates with the following command:

$ ionic start --list

这些模板为任何应用提供了一个很好的起点,并包含了扩展代码库的所有最佳实践。

¥These templates provide a great starting point for any app and include all the best practices for making a code base scale.