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) => {
2121
2222// 更新 app.config.ts 文件
2323const createConfig = async ( ) => {
24- const configRef = [ ]
24+ let configRef = [ ]
2525
2626 return new Promise ( ( res , rej ) => {
2727 config . nav . map ( ( item ) => {
2828 let co = {
2929 root : item . enName ,
3030 pages : [ ] ,
3131 }
32- if ( paramG ) {
33- if ( paramG === item . enName ) {
32+ if ( paramG ) {
33+ if ( paramG === item . enName ) {
3434 item . packages . map ( ( it ) => {
3535 if ( isShow ( it ) ) {
3636 co . pages . push ( `pages/${ it . name . toLowerCase ( ) } /index` )
@@ -49,6 +49,10 @@ const createConfig = async () => {
4949 co = { ...co , pages : co . pages . sort ( ) }
5050 configRef . push ( co )
5151 } )
52+
53+ // 如果 pages 数据为空,则删除该项
54+ configRef = configRef . filter ( ( item ) => item . pages . length !== 0 )
55+
5256 res ( configRef )
5357 } )
5458}
You can’t perform that action at this time.
0 commit comments