mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Update README.md
This commit is contained in:
parent
47286b9ae6
commit
b8c082c57f
@ -642,11 +642,11 @@ Input data passed to a template is made available using a special `data` variabl
|
|||||||
<var name="name" value="data.name.toUpperCase()" />
|
<var name="name" value="data.name.toUpperCase()" />
|
||||||
```
|
```
|
||||||
|
|
||||||
To reassigne an existing variable with a new value always use the `<assign>` tag. For example:
|
To asign a new value to an existing variable the `<assign>` tag can be used as shown in the following sample code:
|
||||||
```html
|
|
||||||
<assign var="name" value="data.lastname" />
|
|
||||||
```
|
|
||||||
|
|
||||||
|
```html
|
||||||
|
<assign var="name" value="data.name.toLowerCase()" />
|
||||||
|
```
|
||||||
|
|
||||||
The `<with>` directive can be used to create scoped variables as shown in the following sample code:
|
The `<with>` directive can be used to create scoped variables as shown in the following sample code:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user