gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 14:41:36 27 4
gpt4 key购买 nike

我是 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 有效.

关于javascript - 如何更改 vue 默认项目信息模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49566589/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com