-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoczrc.js
60 lines (57 loc) · 1.14 KB
/
doczrc.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
52
53
54
55
56
57
58
59
60
import url from 'url';
import packageInfo from './package.json';
/**
* 获取基本URL
*/
function getBaseUrl() {
if (process.env.NODE_ENV === 'production') {
const { name, homepage } = packageInfo;
if (homepage) {
return url.parse(homepage).path;
}
if (name.startsWith('@')) {
return name.substr(name.indexOf('/'));
}
return `/${name}`;
}
return '/';
}
export default {
typescript: true,
files: ['docs/**/*.mdx'],
public: './docs/assets',
menu: [
'开始',
{
name: '教程',
menu: [
'值处理',
'表单初始值与重置',
'表单校验',
'自定义表单域',
'提交表单',
'嵌套表单',
],
},
{
name: 'API',
menu: [
'useFormState',
'FormStateContext',
'Field',
'FieldArray',
'FormValueMonitor',
'useFormStateContext',
'useFormSelect',
'useFormSubmitting',
'useField',
'useFieldState',
'useFieldError',
'useFieldValue',
'useFieldTouched',
'useFieldArray',
],
},
],
base: getBaseUrl(),
};