-
Notifications
You must be signed in to change notification settings - Fork 117
/
prompts.js
51 lines (51 loc) · 1.02 KB
/
prompts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = [{
type: 'list',
name: 'template',
message: '请选择 uni-app 模板',
choices: [{
name: '默认模板',
value: 'default'
},
{
name: '默认模板(TypeScript)',
value: 'default-ts'
},
{
name: 'Hello uni-app',
value: 'dcloudio/hello-uniapp'
},
{
name: '前后一体登录模板',
value: 'dcloudio/uni-template-login'
},
{
name: '看图模板',
value: 'dcloudio/uni-template-picture'
},
{
name: '新闻/资讯类模板',
value: 'dcloudio/uni-template-news'
},
{
name: '自定义模板',
value: 'custom'
}
],
default: 'None'
},
{
when: answers => answers.template === 'custom',
type: 'input',
name: 'repo',
message: '请输入自定义 uni-app 模板地址',
filter (input) {
return new Promise(function (resolve, reject) {
if (input) {
resolve(input)
} else {
reject(new Error('uni-app 模板地址不能为空'))
}
})
}
}
]