(code)
| 976 | } |
| 977 | |
| 978 | analyzeLayoutPerformance(code) { |
| 979 | const notes = []; |
| 980 | |
| 981 | // 检查 Flexbox 性能 |
| 982 | if (code.includes('flex')) { |
| 983 | notes.push('Flexbox 在大量元素时可能影响性能'); |
| 984 | } |
| 985 | |
| 986 | // 检查 Grid 性能 |
| 987 | if (code.includes('grid')) { |
| 988 | notes.push('Grid 布局在复杂嵌套时可能影响性能'); |
| 989 | } |
| 990 | |
| 991 | // 检查动态布局 |
| 992 | if (code.includes('calc')) { |
| 993 | notes.push('calc() 在频繁计算时可能影响性能'); |
| 994 | } |
| 995 | |
| 996 | return notes.join('. '); |
| 997 | } |
| 998 | |
| 999 | getLayoutBrowserSupport(code) { |
| 1000 | const support = { |