mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-06 15:08:27 -06:00
33 lines
718 B
JavaScript
33 lines
718 B
JavaScript
module.exports = cli => {
|
|
cli.injectFeature({
|
|
name: 'Choose Vue version',
|
|
value: 'vueVersion',
|
|
description: 'Choose a version of Vue.js that you want to start the project with',
|
|
checked: true
|
|
})
|
|
|
|
cli.injectPrompt({
|
|
name: 'vueVersion',
|
|
when: answers => answers.features.includes('vueVersion'),
|
|
message: 'Choose a version of Vue.js that you want to start the project with',
|
|
type: 'list',
|
|
choices: [
|
|
{
|
|
name: '2.x',
|
|
value: '2'
|
|
},
|
|
{
|
|
name: '3.x',
|
|
value: '3'
|
|
}
|
|
],
|
|
default: '2'
|
|
})
|
|
|
|
cli.onPromptComplete((answers, options) => {
|
|
if (answers.vueVersion) {
|
|
options.vueVersion = answers.vueVersion
|
|
}
|
|
})
|
|
}
|