@dcloudio/uni-cli-shared 3.0.0-alpha-5020520260824002 → 3.0.0-alpha-5020520260829001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,11 @@ export interface UniXPageOptions {
|
|
|
3
3
|
disableScroll?: boolean;
|
|
4
4
|
enablePullDownRefresh?: boolean;
|
|
5
5
|
scrollIndicator?: 'none';
|
|
6
|
+
enableBackToTop?: boolean;
|
|
7
|
+
bounces?: boolean;
|
|
8
|
+
androidOverscroll?: boolean;
|
|
9
|
+
androidRefresherColor?: string;
|
|
10
|
+
backgroundColor?: string;
|
|
6
11
|
}
|
|
7
12
|
export declare function normalizeUniAppXAppPagesJson(jsonStr: string): UniApp.PagesJson;
|
|
8
13
|
export declare function parseUniXPageOptions(filename: string): UniXPageOptions | undefined;
|
package/dist/json/uni-x/index.js
CHANGED
|
@@ -90,18 +90,27 @@ function updateUniXPageOptions(pagesJson) {
|
|
|
90
90
|
}
|
|
91
91
|
const pageOptions = new Map();
|
|
92
92
|
pagesJson.pages.forEach((page) => {
|
|
93
|
-
pageOptions.set(page.path, normalizeRootPageOptions(page.style));
|
|
93
|
+
pageOptions.set(page.path, normalizeRootPageOptions(page.style, pagesJson.globalStyle));
|
|
94
94
|
});
|
|
95
95
|
uniXPageOptionsCache.set(inputDir, pageOptions);
|
|
96
96
|
}
|
|
97
|
-
function normalizeRootPageOptions(pageStyle) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
97
|
+
function normalizeRootPageOptions(pageStyle, globalStyle) {
|
|
98
|
+
const androidRefresherColor = pageStyle?.androidRefresherColor ?? globalStyle.androidRefresherColor;
|
|
99
|
+
const backgroundColor = pageStyle?.backgroundColor ?? globalStyle.backgroundColor;
|
|
101
100
|
return {
|
|
102
|
-
disableScroll: pageStyle
|
|
103
|
-
enablePullDownRefresh: isEnablePullDownRefresh(pageStyle) || undefined,
|
|
104
|
-
scrollIndicator: pageStyle
|
|
101
|
+
disableScroll: pageStyle?.disableScroll === true || undefined,
|
|
102
|
+
enablePullDownRefresh: (pageStyle && isEnablePullDownRefresh(pageStyle)) || undefined,
|
|
103
|
+
scrollIndicator: pageStyle?.scrollIndicator,
|
|
104
|
+
// 新增的根滚动配置遵循 pages.json 页面样式覆盖全局样式的规则。
|
|
105
|
+
enableBackToTop: pageStyle?.enableBackToTop ?? globalStyle.enableBackToTop,
|
|
106
|
+
bounces: pageStyle?.bounces ?? globalStyle.bounces,
|
|
107
|
+
androidOverscroll: pageStyle?.androidOverscroll ?? globalStyle.androidOverscroll,
|
|
108
|
+
androidRefresherColor: androidRefresherColor?.startsWith('@')
|
|
109
|
+
? undefined
|
|
110
|
+
: androidRefresherColor,
|
|
111
|
+
backgroundColor: backgroundColor?.startsWith('@')
|
|
112
|
+
? undefined
|
|
113
|
+
: backgroundColor,
|
|
105
114
|
};
|
|
106
115
|
}
|
|
107
116
|
function initUniXPageOptions() {
|