<ul{{attributes.addClass('container container-desktop')}}>
when I press Command + / (autoformat), all my classes are without whitespace:
<ul{{attributes.addClass('containercontainer-desktop')}}>
I searched in the settings of Visual Studio Code for a setting. But did not found a solution to disable it.
That's a correct behavior from your IDE, because addClass
with a string parameter is meant to add one class .
For multiple classes, refer to this documentation :
{% set classes = [ 'red', 'green', ] %} <div{{ attributes.addClass(classes) }}></div>
Try this and see if it solves the problem for you.
Open Visual Studio Code and:
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.