Linux command
vue-init 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create a project from
vue init webpack [project-name]
Create a project from
vue init simple [project-name]
Create from a local template
vue init [~/my-template] [project-name]
Create from a GitHub repository
vue init [username/repo] [project-name]
Clone instead of downloading
vue init --clone [username/repo] [project-name]
Use a cached template
vue init --offline [webpack] [project-name]
说明
vue init creates new Vue.js projects from templates. This is a legacy command from Vue CLI 2.x (package: vue-cli). For Vue CLI 3+ (package: @vue/cli), use vue create instead. The command is still useful for custom project templates hosted on GitHub or stored locally. To use it with Vue CLI 3+, install the @vue/cli-init bridge package.
参数
- --clone
- Use git clone instead of downloading a zip archive.
- --offline
- Use a previously cached template instead of downloading.
FAQ
What is the vue-init command used for?
vue init creates new Vue.js projects from templates. This is a legacy command from Vue CLI 2.x (package: vue-cli). For Vue CLI 3+ (package: @vue/cli), use vue create instead. The command is still useful for custom project templates hosted on GitHub or stored locally. To use it with Vue CLI 3+, install the @vue/cli-init bridge package.
How do I run a basic vue-init example?
Run `vue init webpack [project-name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --clone do in vue-init?
Use git clone instead of downloading a zip archive.