(properties)
| 1070 | } |
| 1071 | |
| 1072 | generateOptimizationTips(properties) { |
| 1073 | const tips = []; |
| 1074 | |
| 1075 | if (this.checkLayoutTriggers(properties)) { |
| 1076 | tips.push('考虑使用 transform 替代改变位置和尺寸的属性'); |
| 1077 | } |
| 1078 | if (properties.some(p => p.includes('box-shadow'))) { |
| 1079 | tips.push('大面积阴影考虑使用 filter: drop-shadow() 优化性能'); |
| 1080 | } |
| 1081 | if (properties.some(p => p.includes('@keyframes'))) { |
| 1082 | tips.push('长动画考虑使用 requestAnimationFrame 实现'); |
| 1083 | } |
| 1084 | |
| 1085 | return tips; |
| 1086 | } |
| 1087 | |
| 1088 | analyzeCSSPropertyCategories(properties) { |
| 1089 | return properties.map(prop => ({ |
no test coverage detected