Commit 9042ec0e authored by 郭志伟's avatar 郭志伟

fix(index.ts): 修复tab背景图兼容

parent 355dd3e7
...@@ -107,11 +107,20 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) { ...@@ -107,11 +107,20 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
const activityEle = document.querySelector('.activity'); const activityEle = document.querySelector('.activity');
const activityBgColor = getStyle(activityEle, 'backgroundColor'); const activityBgColor = getStyle(activityEle, 'backgroundColor');
const gridItemEleBgColor = getStyle(gridItemEle, 'backgroundColor'); const gridItemEleBgColor = getStyle(gridItemEle, 'backgroundColor');
const gridItemEleBgImg = getStyle(gridItemEle, 'backgroundImage');
const gridItemEleBgRepeat = getStyle(gridItemEle, 'backgroundRepeat') || 'no-repeat';
const gridItemEleBgSize = getStyle(gridItemEle, 'backgroundSize') || 'auto';
const crTabs = tabsEle.childNodes[0]; const crTabs = tabsEle.childNodes[0];
crTabs.style.backgroundColor = activityBgColor; crTabs.style.backgroundColor = activityBgColor;
const stickyEle = crTabs?.childNodes[0]; const stickyEle = crTabs?.childNodes[0];
if (stickyEle?.classList.contains('cr-sticky') && stickyEle?.childNodes) { if (stickyEle?.classList.contains('cr-sticky') && stickyEle?.childNodes) {
stickyEle.childNodes[0]?.style.backgroundColor = gridItemEleBgColor === 'rgba(0, 0, 0, 0)' ? activityBgColor : gridItemEleBgColor; stickyEle.childNodes[0]?.style.backgroundColor = gridItemEleBgColor === 'rgba(0, 0, 0, 0)' ? activityBgColor : gridItemEleBgColor;
// polyfill backgroundImage
if (gridItemEleBgImg) {
stickyEle.childNodes[0]?.style.backgroundImage = gridItemEleBgImg;
stickyEle.childNodes[0]?.style.backgroundSize = gridItemEleBgSize;
stickyEle.childNodes[0]?.style.backgroundRepeat = gridItemEleBgRepeat;
}
} }
} }
} }
......
This diff is collapsed.
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"backend": "nohup egg-scripts start --port 7001 --workers 4", "backend": "nohup egg-scripts start --port 7001 --workers 4",
"dev": "egg-bin dev -r egg-ts-helper/register", "dev": "egg-bin dev -r egg-ts-helper/register",
"debug": "egg-bin debug -r egg-ts-helper/register", "debug": "egg-bin debug -r egg-ts-helper/register",
"build": "easy build --devtool", "build": "cross-env COS_ENV=production easy build --devtool",
"build:test": "cross-env COS_ENV=test easy build --devtool",
"tsc": "ets && tsc -p tsconfig.json", "tsc": "ets && tsc -p tsconfig.json",
"clean": "ets clean", "clean": "ets clean",
"kill": "easy kill", "kill": "easy kill",
...@@ -46,20 +47,21 @@ ...@@ -46,20 +47,21 @@
"vuex-router-sync": "^5.0.0" "vuex-router-sync": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^3.9.2", "@babel/plugin-syntax-jsx": "^7.12.1",
"@easy-team/easywebpack-cli": "^4.0.0", "@easy-team/easywebpack-cli": "^4.0.0",
"@easy-team/easywebpack-vue": "^4.0.0", "@easy-team/easywebpack-vue": "^4.0.0",
"webpack-sentry-plugin": "^1.16.0", "@types/node": "^10.12.0",
"postcss-px2rem": "^0.3.0", "cross-env": "^7.0.3",
"less": "^3.12.2", "less": "^3.12.2",
"less-loader": "^7.1.0", "less-loader": "^7.1.0",
"postcss-px2rem": "^0.3.0",
"ts-loader": "^5.3.0",
"ts-node": "^7.0.1",
"tslint": "^5.9.1", "tslint": "^5.9.1",
"tslint-eslint-rules": "^5.4.0", "tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.3", "tslint-loader": "^3.5.3",
"ts-loader": "^5.3.0", "typescript": "^3.9.2",
"ts-node": "^7.0.1", "webpack-sentry-plugin": "^1.16.0"
"@babel/plugin-syntax-jsx": "^7.12.1",
"@types/node": "^10.12.0"
}, },
"egg": { "egg": {
"typescript": true "typescript": true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment