BUG错误信息
[Web浏览器] "Uncaught Error: 元素背景颜色必须为RGBA" /js/mui.js (8089)
解决方法:改mui.js
搜索
- var rgbaRegex = /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*(?:\.\d+)?)\)$/;
- var getColor = function(colorStr) {
- var matches = colorStr.match(rgbaRegex);
- if (matches && matches.length === 5) {
- return [
- matches[1],
- matches[2],
- matches[3],
- matches[4]
- ];
- }
复制代码
改为:
- var rgbaRegex = /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*(?:\.\d+)?)\)$/;
- var rgbRegex = /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/;
- var getColor = function(colorStr) {
- var matches = colorStr.match(rgbaRegex);
- var matches1 = colorStr.match(rgbRegex);
- console.log(matches1);
- if (matches && matches.length === 5) {
- return [
- matches[1],
- matches[2],
- matches[3],
- matches[4]
- ];
- } else if(matches1 && matches1.length === 4) {
- return [
- matches1[1],
- matches1[2],
- matches1[3],
- 1.0
- ];
- }
- return [];
- };
复制代码
错误解决 |