Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit40c58c3

Browse files
committed
simplify example
1 parent019b7d1 commit40c58c3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎pyscriptjs/examples/todo-pylist.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<htmllang="en">
33
<head>
44
<metacharset="utf-8"/>
5-
<metaname="viewport"content="width=device-width,initial-scale=1"/>
65

76
<title>Todo App</title>
87

@@ -14,25 +13,23 @@
1413
- paths:
1514
- /utils.py
1615
</py-env>
17-
<py-register-widgetsrc="/pylist.py"name="py-list"klass="PyList"></py-widget>
16+
<py-register-widgetsrc="/pylist.py"name="py-list"klass="PyList"></py-register-widget>
1817
</head>
1918

2019
<body>
2120
<py-title>To Do List</py-title>
22-
<py-boxwidths="2/3;1/3">
21+
<py-boxwidths="4/5;1/5">
2322
<py-inputboxid="new-task-content">
2423
def on_keypress(e):
2524
if (e.code == "Enter"):
2625
add_task()
2726
</py-inputbox>
2827
<py-buttonid="new-task-btn"label="Add Task!">
2928
def on_click(evt):
30-
task = { "content": new_task_content.value, "done": False, "created_at": dt.now() }
31-
myList.add(PyItem(task, labels=['content'], state_key="done"))
32-
new_task_content.clear()
29+
add_task()
3330
</button>
3431
</py-box>
35-
32+
3633
<py-listid="myList"></py-list>
3734
<py-replid="my-repl"auto-generate="true"></py-repl>
3835
</body>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp