We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd9f30b commit e84f671Copy full SHA for e84f671
1 file changed
scripts/harmony/update-taro-entry.js
@@ -21,16 +21,16 @@ const isShow = (item) => {
21
22
// 更新 app.config.ts 文件
23
const createConfig = async () => {
24
- const configRef = []
+ let configRef = []
25
26
return new Promise((res, rej) => {
27
config.nav.map((item) => {
28
let co = {
29
root: item.enName,
30
pages: [],
31
}
32
- if(paramG) {
33
- if(paramG === item.enName){
+ if (paramG) {
+ if (paramG === item.enName) {
34
item.packages.map((it) => {
35
if (isShow(it)) {
36
co.pages.push(`pages/${it.name.toLowerCase()}/index`)
@@ -49,6 +49,10 @@ const createConfig = async () => {
49
co = { ...co, pages: co.pages.sort() }
50
configRef.push(co)
51
})
52
+
53
+ // 如果 pages 数据为空,则删除该项
54
+ configRef = configRef.filter((item) => item.pages.length !== 0)
55
56
res(configRef)
57
58
0 commit comments