The first example vue cli

1. Installation Environment

  After installing node, execution

  npm install -g @vue/cli

  npm install -g @ vue / cli-service-global (can be used with vue serve vue build command)

 2. Create a project

   Command line: vue create the project name (in English, lowercase)

    Then automatically or manually select the template using the technique to be used point (final option to save into a new template location in ~ / .vuerc lower)

   Graphical style: vue ui, pop-up browser, to guide the project creation process 

   Note: currently in use are vue cli 3.0, if you want to use the framework vue cli 2.X, installation (npm install -g @ vue / cli-init), to create a project (vue init webpack project name) 

 

 

Set of commands:

1.vue serve that contains app.vue running the current command (index.js main.js \ \ in a App.vue) directory, start the service.

   Used to create a project with vue create the same default settings (WebPACK, Babel, PostCSS and ESLint ).

   Can explicitly specify the file entry, such vue serve MyComponent.vue

   Additional parameters: -o --open open the browser, -c --copy local copy url, -h --help output usage information  Liu

2.vue build

   Construct 

   Additional parameters:

  -t, --target <target> build target (app | lib | wc | wc-async, default value: app)
  -n, --name <name> library name or a name (default: entrance filename) Web Components assembly
  -d, --dest <dir> output directory (default: dist)
  -h, --help output usage information

3.vue create

    Additional parameters:

  -p, --preset <presetName> ignore the prompt and use the saved preset option or remote
  -d, --default ignore the prompt and use the default preset options
  -i, --inlinePreset <json> ignore the prompt and use JSON string preset options inline
  -m, --packageManager <command> npm specified when the client installation depends
  -r, --registry <url> npm registry specified during installation dependent
  -g, --git [message] Forced / skip git initialized and specifies the initialization information submitted optionally
  -n, --no-git git initialization skipped
  -f, --force overwrite the target directory configuration that may exist
  -c, --clone use git clone obtain remote preset options
  -x, --proxy create a project using the specified proxy
  -b, omitted the default novice assembly instructions when you create a project --bare
  -h, --help output help information use

 

Guess you like

Origin www.cnblogs.com/liucuiqiang/p/11506023.html