提交 a7446b7d 编写于 作者: D DCloud_LXH

fix(app): webview Preference is given to the page background color

上级 1a9113a5
import { isPlainObject, hasOwn, extend, capitalize, isString } from 'uni-shared';
import { isPlainObject, hasOwn, extend, capitalize, isStr as isString } from 'uni-shared';
let callbackId = 1;
let proxy;
const callbacks = {};
......@@ -279,6 +279,6 @@ function requireUTSPlugin(name) {
console.error(`${name} is not found`);
}
return define;
}
export { initUTSClassName, initUTSIndexClassName, initUTSPackageName, initUTSProxyClass, initUTSProxyFunction, normalizeArg, registerUTSInterface, registerUTSPlugin, requireUTSPlugin };
}
export { initUTSClassName, initUTSIndexClassName, initUTSPackageName, initUTSProxyClass, initUTSProxyFunction, normalizeArg, registerUTSInterface, registerUTSPlugin, requireUTSPlugin };
......@@ -44,13 +44,15 @@ export function parseWebviewStyle (id, path, _routeOptions = {}) {
}
})
const backgroundColor = routeOptions.window.backgroundColor
let backgroundColor = routeOptions.window.backgroundColor
if (
/^#[a-z0-9]{6}$/i.test(backgroundColor) ||
backgroundColor === 'transparent'
) {
if (!webviewStyle.background) {
webviewStyle.background = backgroundColor
} else {
backgroundColor = webviewStyle.background
}
if (!webviewStyle.backgroundColorTop) {
webviewStyle.backgroundColorTop = backgroundColor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册