再更新test.dart

This commit is contained in:
shenjack 2024-03-05 20:48:58 +08:00
parent 65f758b5f6
commit 18bb5cf9cd
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 107 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,35 @@
import 'dart:js' as Js;
import 'dart:html';
SpanElement Span(String cls) {
return new SpanElement()..classes.add(cls);
}
DivElement Div(String cls) {
return new DivElement()..classes.add(cls);
}
TableCellElement TD(TableRowElement tr){
TableCellElement td = new TableCellElement();
tr.append(td);
return td;
}
ParagraphElement P(String cls) {
return new ParagraphElement()..classes.add(cls);
}
String b(String str) {
return str;
}
String smile(String str) {
return '<div class="smile s_$str"></div>';
}
String l(String str, String key) {
return str;
}
void main() {
// Find an element by id (an-id).
Element idElement = querySelector('#an-id')!;
@ -12,6 +41,12 @@ void main() {
// Find all elements by tag (<div>).
List<Element> divElements = querySelectorAll('div');
TableRowElement tr = new TableRowElement();
TD(tr)..text = l('击杀','killedCount')..style.width = '44px';
TD(tr)..text = l('致命一击','killerName')..style.minWidth = '112px';
DivElement plist = document.querySelector('.plist') as DivElement;
DivElement pbody = document.querySelector('.pbody') as DivElement;
print(idElement);
print(classElement);