支持 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`);
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)),

View File

@ -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,