Applying nested object of attributes in Jade/Pug
问题 Is there a way to pass an object of data/aria attributes to an element? I've tried: div(data={foo:'bar'}) div(data={foo='bar'}) div&attributes({aria:{foo:'bar'}}) But none of these output the desired attribute notation. The first and third place an object literal in the base data/aria attribute. The second is a syntax error. The only ways that I can find that work are: div(data-foo='bar') div&attributes({'aria-foo':'bar'}) 回答1: By leading new lines with a minus - you are able to write regular