4👍
✅
In Vue, I would put a logic as complicated as yours in the script
, not in the template. You could e. g. put your whole expression in a function in the computed section, and then just call this function in the template.
Source:stackexchange.com