0

Inquirer为命令提示工具安装了软件包,并编写了这个简单的提示:

function promptUser(): void {
    console.clear();
    displayTodoList(); // harmless method. 

    inquirer.prompt({
        type: "list",
        name: "command",
        message: "Choose option",
        choices: Object.values(Commands)
    }).then(answers => {
        if (answers["command"] !== Commands.Quit) {
            promptUser(); // some other harmless method.
        }
    })
}

但是 Typescript 给了我values在类型 ' ' 上不存在的编译错误,ObjectConstructor即这一行:

choices: Object.values(Commands)
4

0 回答 0