-
Notifications
You must be signed in to change notification settings - Fork 644
Deprecation: vars is deprecated
Michael Rawlings edited this page Jun 13, 2023
·
4 revisions
The var
and vars
taglib properties are deprecated. Use tag parameters instead.
To take the example from marko-js-samples/scoped-variables
:
In the usage of the tag, remove the var
attribute and receive the variable as a tag parameter instead:
- <date-now var="now">
+ <date-now|now|>
The current time is ${now.time}.
The current date is ${now.dayOfWeek}, ${now.month} ${now.dayOfMonth}, ${now.year}
</date-now>
And update the <date-now>
custom tag to remove the vars
property in the taglib/date-now/marko-tag.json file:
{
"renderer": "./renderer",
- "@var": "identifier",
- "vars": [
- {
- "name-from-attribute": "var"
- }
- ]
}
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.