Skip to content

Commit 8dcd11c

Browse files
author
梶塚太智
committed
Implement command of remove-child
1 parent 0ef9fbe commit 8dcd11c

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

example.html

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@
33

44
<head>
55
<meta charset="UTF-8">
6+
<title>Stack.js Example</title>
67
</head>
78

89
<body>
910

10-
<button id="btn">何が起きるかな?</button>
11-
<div id="msg"></div>
11+
<button id="add">追加</button>
12+
<button id="del">削除</button>
13+
<div id="area"></div>
1214

1315
<div class="stack">
1416
(
15-
(msg) get-element-by-id (msg) var
16-
(p) create-element (text) var
17-
(Stackは素晴らしい!) text set-inner-html
18-
text msg append-child
17+
(area) get-element-by-id (area) var
18+
(p) create-element (msg) var (msg) msg set-id
19+
(Stackは素晴らしい!) msg set-inner-html
20+
msg area append-child
1921
) (click)
20-
(btn) get-element-by-id add-event-listener
22+
(add) get-element-by-id add-event-listener
23+
24+
(
25+
(area) get-element-by-id (area) var
26+
(msg) get-element-by-id area remove-child
27+
) (click)
28+
(del) get-element-by-id add-event-listener
2129
</div>
2230

2331
<script src="https://stack-community.github.io/stack.js" type="module"></script>

pkg/web_stack.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ function __wbg_get_imports() {
375375
const ret = getObject(arg0).appendChild(getObject(arg1));
376376
return addHeapObject(ret);
377377
}, arguments) };
378+
imports.wbg.__wbg_removeChild_96bbfefd2f5a0261 = function() { return handleError(function (arg0, arg1) {
379+
const ret = getObject(arg0).removeChild(getObject(arg1));
380+
return addHeapObject(ret);
381+
}, arguments) };
378382
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
379383
const ret = new Function(getStringFromWasm0(arg0, arg1));
380384
return addHeapObject(ret);

pkg/web_stack_bg.wasm

395 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)