Skip to content

Commit 867c7ea

Browse files
save file
1 parent d473f2e commit 867c7ea

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

html/chat-room/chat-room.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,26 +162,32 @@
162162

163163
var shadow = host.shadowRoot;
164164

165-
console.log(host.childNodes);
166-
167165
var tabs = $(shadow,'#tabs');
168166
tab = $(tabs,'.tab');
169167
tab.remove();
170168
tab.style.display = '';
171169

170+
view = $(shadow,'#view');
172171

173172
var first;
174173
for(let key in input){
175174

175+
ley nn = 'chat-room-'+key;
176176
let ntab = tab.cloneNode(true);
177177
ntab.textContent = key;
178-
tabs.append(ntab);
179178
ntab.onclick = e=>console.log('click',key);
179+
tabs.append(ntab);
180+
181+
let node = $(host,nn);
182+
view.append(node);
183+
180184
if(!first){
181185
first = ntab;
182186
first.classList.add('active');
187+
node.style.display = '';
183188
}else{
184189
ntab.classList.add('inactive');
190+
node.style.display = 'none';
185191
}
186192

187193
}//for

0 commit comments

Comments
 (0)