File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,16 @@ const isShow = (item) => {
21
21
22
22
// 更新 app.config.ts 文件
23
23
const createConfig = async ( ) => {
24
- const configRef = [ ]
24
+ let configRef = [ ]
25
25
26
26
return new Promise ( ( res , rej ) => {
27
27
config . nav . map ( ( item ) => {
28
28
let co = {
29
29
root : item . enName ,
30
30
pages : [ ] ,
31
31
}
32
- if ( paramG ) {
33
- if ( paramG === item . enName ) {
32
+ if ( paramG ) {
33
+ if ( paramG === item . enName ) {
34
34
item . packages . map ( ( it ) => {
35
35
if ( isShow ( it ) ) {
36
36
co . pages . push ( `pages/${ it . name . toLowerCase ( ) } /index` )
@@ -49,6 +49,10 @@ const createConfig = async () => {
49
49
co = { ...co , pages : co . pages . sort ( ) }
50
50
configRef . push ( co )
51
51
} )
52
+
53
+ // 如果 pages 数据为空,则删除该项
54
+ configRef = configRef . filter ( ( item ) => item . pages . length !== 0 )
55
+
52
56
res ( configRef )
53
57
} )
54
58
}
You can’t perform that action at this time.
0 commit comments