Skip to content

Commit 21ccd2f

Browse files
kazuponAkryum
authored andcommitted
docs: fix prompts API codes (#1557)
1 parent 6e690f3 commit 21ccd2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/dev-guide/plugin-dev.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ A prompt module should export a function that receives a [PromptModuleAPI][promp
246246
``` js
247247
module.exports = api => {
248248
// a feature object should be a valid inquirer choice object
249-
cli.injectFeature({
249+
api.injectFeature({
250250
name: 'Some great feature',
251251
value: 'my-feature'
252252
})
253253

254254
// injectPrompt expects a valid inquirer prompt object
255-
cli.injectPrompt({
255+
api.injectPrompt({
256256
name: 'someFlag',
257257
// make sure your prompt only shows up if user has picked your feature
258258
when: answers => answers.features.include('my-feature'),
@@ -262,7 +262,7 @@ module.exports = api => {
262262

263263
// when all prompts are done, inject your plugin into the options that
264264
// will be passed on to Generators
265-
cli.onPromptComplete((answers, options) => {
265+
api.onPromptComplete((answers, options) => {
266266
if (answers.features.includes('my-feature')) {
267267
options.plugins['vue-cli-plugin-my-feature'] = {
268268
someFlag: answers.someFlag

0 commit comments

Comments
 (0)