Part 2 — States and Widgets [Customize modal window]
In this section, we will customize the modal window. We will use a modal window to enter arguments.
Table of contents
Step 1 — About states
Have you heard about the state machine? It is the same. State fields help the application core store lightweight data and pass it to Python as needed.
To use states
in our application, we need to initialize them.
For a modal window application, this does it in config.json
config.json (partially)
Remember the states. We'll need them to pass arguments from HTML to Python.
Step 2 — Element widgets
Element widgets are available in our core. We can easily add an input box:
src/modal.html
Have you forgotten about states yet? Using the v-model parameter, we bind the APP core to the UI.
Step 3 — Blind it all together
Python code is a regular timer:
src/main.py
Step 4 — Results
Last updated