From 56d13272a40f7b39ad1452d8a699c8d3a120fc8c Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 9 Jun 2023 10:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8B=E6=9D=A5=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/serve.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/serve.js b/bin/serve.js index f4931b5b..c6a1af7f 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -3,19 +3,22 @@ const {chalkTag, findPages, fs, fsExtra} = require("./tools"); let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: 'wxwork'} const getFileInfo = (app, file) => { let vue = fs.readFileSync(file).toString() + //获取模块名称 if (/appName/.test(vue)) { let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1') app.label = appName.replace(/(appName:|["'])/g, '').trim() - if (/customNavigation/.test(vue)) { - app.style = {navigationStyle: "custom"} - } else app.style = {navigationBarTitleText: app.label} - if (/enablePullDownRefresh/.test(vue)) { - app.style.enablePullDownRefresh = true - } } + // 处理页面自定义选项 + if (/customNavigation/.test(vue)) { + app.style = {navigationStyle: "custom"} + } else app.style = {navigationBarTitleText: app.label} + if (/enablePullDownRefresh/.test(vue)) { + app.style.enablePullDownRefresh = true + } + // 处理和统计模块应用数据 if (/^App/.test(app.name) && app.label) { let {name, label} = app, - path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) + path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) return apps.list.push({ id: file.replace(/\.\/?(vue)?/g, '').replace(/[\\\/]/g, '_'), name,