MCPcopy
hub / github.com/ys1231/MoveCertificate / showSkeleton

Function showSkeleton

webdev/src/ui-renderer.ts:103–114  ·  view source on GitHub ↗
(containerId: string, lineCount: number = 3)

Source from the content-addressed store, hash-verified

101 * 数据还没加载完时显示灰色条纹动画,告诉用户"正在加载中"
102 */
103export function showSkeleton(containerId: string, lineCount: number = 3): void {
104 const el = document.getElementById(containerId);
105 if (!el) return;
106
107 el.innerHTML = '';
108 for (let i = 0; i < lineCount; i++) {
109 const line = document.createElement('div');
110 // 最后一行短一点,看起来更自然
111 line.className = 'skeleton skeleton-line' + (i === lineCount - 1 ? ' short' : '');
112 el.appendChild(line);
113 }
114}
115
116/**
117 * 隐藏骨架屏

Callers 4

loadCertsTabFunction · 0.85
loadModeTabFunction · 0.85
loadLogTabFunction · 0.85
refreshLogTabFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected