{{r.status == 'active' or 'scheduled' ? 'The order status is <a href="https://example.com/">
{{r.order}} : 'The order status is cancelled'</a>'
When using the line above it prints {{r.order}} instead of the value from the variable. How can I print the value?
You may use the in
operator combined with string interpolation and the raw
filter :
{{r.status in ['active', 'scheduled']
? "The order status is <a href=\"https://example.com/\">#{r.order}</a>"|raw
: 'The order status is cancelled'}}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.