添加一些别的 postMessage

This commit is contained in:
shenjack 2024-03-23 11:21:43 +08:00
parent a536d4a995
commit 8eb2c167c9
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 264 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -112,6 +112,19 @@ void main() {
// Find all elements by tag (<div>).
List<Element> divElements = querySelectorAll('div');
List<double> double_list = [1.0, 2.0, 3.0];
//
double_list.add(4.0);
double_list.removeAt(0);
double_list[0] = 5.0;
print(double_list[0]);
//
double_list.forEach((element) {
print(element);
});
// call setTimeout
Js.context.callMethod('setTimeout', [Js.allowInterop(() {
print("延时1秒执行");
@ -155,6 +168,8 @@ void main() {
print(test_map.toString());
//
test_map.clear();
// window.parent.postMessage
window.parent?.postMessage("什么奇怪东西", "*");
print(test_map);