mirror of
https://github.com/esiur/iui.git
synced 2025-05-06 14:52:58 +00:00
25 lines
725 B
Markdown
25 lines
725 B
Markdown
# Scope Variables
|
|
|
|
Scope variables are provided during the rendering process to the scripts and declarative rendering functions.
|
|
|
|
These variables propagate from an element to its children and could be altered or overwritten by any element in the tree so the children of that element receive a new value for these variables.
|
|
|
|
|
|
<i-codepreview>
|
|
<div :scope="{now: new Date()}">
|
|
<div>Date: ${now.toDateString()}</div>
|
|
<div>Time: ${now.toTimeString()}</div>
|
|
</div>
|
|
</i-codepreview>
|
|
|
|
# Events
|
|
|
|
Events can access scope variables when declared with *@eventName*
|
|
|
|
<i-codepreview>
|
|
<div :scope="{now: new Date()}">
|
|
<button @click="this.innerHTML = now">Click me</button>
|
|
</div>
|
|
</i-codepreview>
|
|
|