如何更改 vue 默认项目信息模板?

How to change vue default project info template?

我是 vue.js 和 vuetify.js 的新手。当我使用命令

vue init webpack app

vue会给出一些默认的项目设置,比如项目名称,作者,.. 问题是,默认设置从哪里来?如何更改为我自定义的默认设置,以便更快地创建更多项目?

您可以通过以下方式使用自己的模板:

vue init username/repo my-project-name

详情from the official repo:

Custom Templates

It's unlikely to make everyone happy with the official templates. You can simply fork an official template and then use it via vue-cli with:

vue init username/repo my-project

Where username/repo is the GitHub repo shorthand for your fork.

The shorthand repo notation is passed to download-git-repo so you can also use things like bitbucket:username/repo for a Bitbucket repo and username/repo#branch for tags or branches.

If you would like to download from a private repository use the --clone flag and the cli will use git clone so your SSH keys are used.

Local Templates

Instead of a GitHub repo, you can also use a template on your local file system:

vue init ~/fs/path/to-custom-template my-project


分步示例:

这对Vue-cli v2.x有效。