MCPcopy Index your code
hub / github.com/iChochy/NCE / renderUnitList

Method renderUnitList

js/ReadingSystem.js:248–261  ·  view source on GitHub ↗

* 渲染单元列表(左侧边栏)

()

Source from the content-addressed store, hash-verified

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 * 渲染单元下拉选择器

Callers 1

applyBookChangeMethod · 0.95

Calls 1

setHTMLFunction · 0.90

Tested by

no test coverage detected