mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-13 10:39:38 -06:00
24 lines
486 B
JavaScript
24 lines
486 B
JavaScript
module.exports = class PromptModuleAPI {
|
|
constructor (creator) {
|
|
this.creator = creator
|
|
}
|
|
|
|
injectFeature (feature) {
|
|
this.creator.featurePrompt.choices.push(feature)
|
|
}
|
|
|
|
injectPrompt (prompt) {
|
|
this.creator.injectedPrompts.push(prompt)
|
|
}
|
|
|
|
injectOptionForPrompt (name, option) {
|
|
this.creator.injectedPrompts.find(f => {
|
|
return f.name === name
|
|
}).choices.push(option)
|
|
}
|
|
|
|
onPromptComplete (cb) {
|
|
this.creator.promptCompleteCbs.push(cb)
|
|
}
|
|
}
|