type: ‘confirm’ 和 type: 'expand’为什么不能同时使用呢?
代码:
inquirer
.prompt([
{
type: 'confirm',
name: 'choice',
message: 'my choice',
default: false
}
, {
type: 'expand',
name: 'choice',
message: 'my choice',
default: 'zyb',
choices: [
{ key: 'Z', value: 'zyb'},
{ key: 'R', value: 'roll'},
{ key: 'K', value: 'kitty'},
],
}
...
输出结果
PS D:\study\cli\commander> qgs-com
? my choice Yes
answers { choice: true }
PS D:\study\cli\commander>