MaCH repo
This commit is contained in:
19
05_todo_sse_datastar/todos.mustache.html
Normal file
19
05_todo_sse_datastar/todos.mustache.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{< layout}}
|
||||
{{$head}}
|
||||
{{> datastar }}
|
||||
{{/head}}
|
||||
{{$body}}
|
||||
<input type="text" placeholder="new todo" data-bind:title
|
||||
data-on:keydown="evt.key === 'Enter' && @post('{{utl:todos}}') && ($title = '');"
|
||||
>
|
||||
<button data-on:click="@post('{{url:todos}}') && ($title = '')">add</button>
|
||||
<div id="todos" data-init="@get('{{url:todos}}?http_method=sse')">
|
||||
{{^todos}}
|
||||
<p>no todos</p>
|
||||
{{/todos}}
|
||||
{{#todos}}
|
||||
{{> todo_item}}
|
||||
{{/todos}}
|
||||
</div>
|
||||
{{/body}}
|
||||
{{/layout}}
|
||||
Reference in New Issue
Block a user