再更新test.dart
This commit is contained in:
parent
65f758b5f6
commit
18bb5cf9cd
File diff suppressed because one or more lines are too long
@ -2,6 +2,35 @@
|
|||||||
import 'dart:js' as Js;
|
import 'dart:js' as Js;
|
||||||
import 'dart:html';
|
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() {
|
void main() {
|
||||||
// Find an element by id (an-id).
|
// Find an element by id (an-id).
|
||||||
Element idElement = querySelector('#an-id')!;
|
Element idElement = querySelector('#an-id')!;
|
||||||
@ -12,6 +41,12 @@ void main() {
|
|||||||
// Find all elements by tag (<div>).
|
// Find all elements by tag (<div>).
|
||||||
List<Element> divElements = querySelectorAll('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(idElement);
|
||||||
print(classElement);
|
print(classElement);
|
||||||
|
Loading…
Reference in New Issue
Block a user