* 渲染单元列表(左侧边栏)
()
| 246 | * 渲染单元列表(左侧边栏) |
| 247 | */ |
| 248 | renderUnitList() { |
| 249 | if (!this.dom.unitList) return; |
| 250 | |
| 251 | const html = this.state.units |
| 252 | .map( |
| 253 | (unit, index) => |
| 254 | `<div class="unit-item" data-unit-index="${index}" tabindex="0" role="button" aria-label="打开 ${unit.title}"> |
| 255 | <h3>${unit.title}</h3> |
| 256 | </div>` |
| 257 | ) |
| 258 | .join(''); |
| 259 | |
| 260 | setHTML(this.dom.unitList, html); |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * 渲染单元下拉选择器 |
no test coverage detected