请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

type: 'confirm' 和 type: 'expand'为什么不能同时使用呢?

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> 

正在回答 回答被采纳积分+3

1回答

扬_灵 2023-07-26 21:53:12

同学你好,你想要实现的效果是怎样的?

0 回复 有任何疑惑可以回复我~
  • 提问者 慕容6072339 #1
    我是在做测试,发现confirm和expand这两种类型不能同时被使用。
    回复 有任何疑惑可以回复我~ 2023-07-27 17:30:11

相似问题

登录后可查看更多问答,登录/注册

问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号