From 41f3539d4dbbedba14b365e74a8e3716f894e4bf Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Thu, 22 Sep 2022 16:40:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=20enablePullDownRefresh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/babel-plugin/router.js | 21 ++++++++++++++++----- config/web/webpack.config.js | 1 + 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/config/babel-plugin/router.js b/config/babel-plugin/router.js index b393af3..efb1fc4 100644 --- a/config/babel-plugin/router.js +++ b/config/babel-plugin/router.js @@ -257,13 +257,22 @@ function getRouter({ projectOrPath, path, namespace, disableAssemble, isFirst }) const jsonFileExists = fs.existsSync(`${relPath}.json`); let meta = []; if (jsonFileExists) { - const { navigationBarTitleText } = require(`${relPath}.json`); + const { + navigationBarTitleText, + enablePullDownRefresh, + } = require(`${relPath}.json`); meta.push( t.objectProperty( t.identifier('title'), t.stringLiteral(navigationBarTitleText || '') ) ); + meta.push( + t.objectProperty( + t.identifier('enablePullDownRefresh'), + t.booleanLiteral(enablePullDownRefresh || true) //默认启用下拉刷新 + ) + ); } const path2 = @@ -319,13 +328,15 @@ function getNamespaceRouter({ namespaces, namespace, filename }) { const jsonFileExists = fs.existsSync(`${relPath}.json`); let meta = []; if (jsonFileExists) { - const { navigationBarTitleText } = require(`${relPath}.json`); - meta = [ + const { + navigationBarTitleText, + } = require(`${relPath}.json`); + meta.push( t.objectProperty( t.identifier('title'), t.stringLiteral(navigationBarTitleText || '') - ), - ]; + ) + ); } const properties = [ t.objectProperty(t.identifier('path'), t.stringLiteral(namespace)), diff --git a/config/web/webpack.config.js b/config/web/webpack.config.js index 0c92491..d3eaccb 100644 --- a/config/web/webpack.config.js +++ b/config/web/webpack.config.js @@ -845,6 +845,7 @@ module.exports = function (webpackEnv) { }, mode: 'write-references', // profile: true, + memoryLimit: 4096, }, issue: { // This one is specifically to match during CI tests,