mirror of
https://github.com/Django-LiveView/docs.git
synced 2024-12-23 03:15:36 +01:00
Update
This commit is contained in:
parent
afd567fa46
commit
ea21007d5e
10
one.org
10
one.org
@ -427,7 +427,6 @@ For example, you can create a link to the ~blog single~ page with the ~slug~ of
|
|||||||
|
|
||||||
#+BEGIN_SRC html
|
#+BEGIN_SRC html
|
||||||
<a
|
<a
|
||||||
data-controller="page"
|
|
||||||
data-action="click->page#changePage"
|
data-action="click->page#changePage"
|
||||||
data-page="blog_single"
|
data-page="blog_single"
|
||||||
data-slug="{{ article.slug }}"
|
data-slug="{{ article.slug }}"
|
||||||
@ -820,6 +819,7 @@ Create a folder called ~templates~, or use your template folder, inside your App
|
|||||||
<body
|
<body
|
||||||
data-host="{{ request.get_host }}"
|
data-host="{{ request.get_host }}"
|
||||||
data-debug="{{ DEBUG }}"
|
data-debug="{{ DEBUG }}"
|
||||||
|
data-controller="page"
|
||||||
>
|
>
|
||||||
<section id="loading"></section>
|
<section id="loading"></section>
|
||||||
<section id="notifications" class="notifications"></section>
|
<section id="notifications" class="notifications"></section>
|
||||||
@ -849,9 +849,13 @@ Create a folder called ~pages~ in your template folder and inside it create a fi
|
|||||||
{# my-app/templates/pages/home.html #}
|
{# my-app/templates/pages/home.html #}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
<main data-controller="home">
|
<main>
|
||||||
<p>
|
<p>
|
||||||
<button data-action="click->home#randomNumber">Random number</button>
|
<button
|
||||||
|
data-action="click->page#run"
|
||||||
|
data-liveview-action="home"
|
||||||
|
data-liveview-function="random_number"
|
||||||
|
>Generate random number</button>
|
||||||
</p>
|
</p>
|
||||||
<h2 id="output-random-number"></h2>
|
<h2 id="output-random-number"></h2>
|
||||||
</main>
|
</main>
|
||||||
|
Loading…
Reference in New Issue
Block a user