支持 enablePullDownRefresh

This commit is contained in:
Wang Kejun 2022-09-22 16:40:15 +08:00
parent b83785bca6
commit 41f3539d4d
2 changed files with 17 additions and 5 deletions

View File

@ -257,13 +257,22 @@ function getRouter({ projectOrPath, path, namespace, disableAssemble, isFirst })
const jsonFileExists = fs.existsSync(`${relPath}.json`); const jsonFileExists = fs.existsSync(`${relPath}.json`);
let meta = []; let meta = [];
if (jsonFileExists) { if (jsonFileExists) {
const { navigationBarTitleText } = require(`${relPath}.json`); const {
navigationBarTitleText,
enablePullDownRefresh,
} = require(`${relPath}.json`);
meta.push( meta.push(
t.objectProperty( t.objectProperty(
t.identifier('title'), t.identifier('title'),
t.stringLiteral(navigationBarTitleText || '') t.stringLiteral(navigationBarTitleText || '')
) )
); );
meta.push(
t.objectProperty(
t.identifier('enablePullDownRefresh'),
t.booleanLiteral(enablePullDownRefresh || true) //默认启用下拉刷新
)
);
} }
const path2 = const path2 =
@ -319,13 +328,15 @@ function getNamespaceRouter({ namespaces, namespace, filename }) {
const jsonFileExists = fs.existsSync(`${relPath}.json`); const jsonFileExists = fs.existsSync(`${relPath}.json`);
let meta = []; let meta = [];
if (jsonFileExists) { if (jsonFileExists) {
const { navigationBarTitleText } = require(`${relPath}.json`); const {
meta = [ navigationBarTitleText,
} = require(`${relPath}.json`);
meta.push(
t.objectProperty( t.objectProperty(
t.identifier('title'), t.identifier('title'),
t.stringLiteral(navigationBarTitleText || '') t.stringLiteral(navigationBarTitleText || '')
), )
]; );
} }
const properties = [ const properties = [
t.objectProperty(t.identifier('path'), t.stringLiteral(namespace)), t.objectProperty(t.identifier('path'), t.stringLiteral(namespace)),

View File

@ -845,6 +845,7 @@ module.exports = function (webpackEnv) {
}, },
mode: 'write-references', mode: 'write-references',
// profile: true, // profile: true,
memoryLimit: 4096,
}, },
issue: { issue: {
// This one is specifically to match during CI tests, // This one is specifically to match during CI tests,