我正在学习 Angular Schematics 并且在数组类型输入方面遇到了一些问题。
当系统提示我输入一个值并按 Enter 时,该值会消失。输入数组值的正确方法是什么?
我的schema.json如下:
{
"$schema": "http://json-schema.org/schema",
"id": "HelloWorldSchematics",
"title": "Hello World Options Schema",
"type": "object",
"properties": {
"listName": {
"type": "string",
"description": "The name of the list.",
"$default": {
"$source": "argv",
"index": 0
},
"x-prompt": "What's the name of list"
},
"colNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "The name of the columns.",
"x-prompt": "What's the name of columns"
}
},
"required": [
"listName",
"colNames"
]
}