git

ionic 入门

基础

Posted by Gao Fei on March 12, 2020

ionic 入门

1. 通过npm搭建开发环境

# 安装ionic 命令行工具
$ sudo npm install -g @ionic/cli



2. 初始化项目


$ ionic start <name> <template> [options]

Inputs:

    name ..... The name of your new project (e.g. myApp,
                                      "My App")
    template ..... The starter template to use (e.g. blank,
                                      tabs; use --list to see all)

  Options:

    --list, -l .... List available starter templates
    --type=<type> ..... Type of project to start (e.g. angular,
                                      react, ionic-angular, ionic1)
    --cordova ... Include Cordova integration
    --capacitor ... (experimental) Include Capacitor
                                      integration
    --id=<id> ...... Specify an Ionic App ID to link

  Advanced Options:

    --no-deps ..... Do not install npm/yarn dependencies
    --no-git .... Do not initialize a git repo
    --link ...... Connect your new app to Ionic
    --project-id=<slug> ... Specify a slug for your app (used for the
                                      directory name and package name)
    --package-id=<id> ..... Specify the bundle ID/application ID for
                                      your app (reverse-DNS notation)
                                      
#创建名为myApp的工程 使用v4 TLS 版本
$ ionic start myApp sidemenu --V4
$ ionic start myApp tabs