* 单选列表
(
message: string,
choices: Choice[],
options: SelectOptions = {}
)
| 88 | * 单选列表 |
| 89 | */ |
| 90 | public static async select( |
| 91 | message: string, |
| 92 | choices: Choice[], |
| 93 | options: SelectOptions = {} |
| 94 | ): Promise<any> { |
| 95 | const answers = await inquirer.prompt([ |
| 96 | { |
| 97 | type: 'list', |
| 98 | name: 'value', |
| 99 | message: UIStyles.component.label(message), |
| 100 | choices: choices.map(choice => ({ |
| 101 | name: choice.name, |
| 102 | value: choice.value, |
| 103 | short: choice.short || choice.name, |
| 104 | disabled: choice.disabled, |
| 105 | })), |
| 106 | pageSize: 10, |
| 107 | ...options, |
| 108 | }, |
| 109 | ]); |
| 110 | return answers.value; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * 多选列表 |
no outgoing calls
no test coverage detected