我需要在mixin属性中编写多行文字。但是找不到正确的方法。
所有这些方法均无效:
+someMixin({
key: "text in \n two lines"
})
+someMixin({
key: "text in two lines"
})
+someMixin({
key: `text in${ }two lines`
})
+someMixin({
key: `text in#{ }two lines`
})
+someMixin({
key: `text in${\n}two lines`
})
+someMixin({
key: `text in#{\n}two lines`
})
+someMixin({
key: `text in#{br}two lines`
})
+someMixin({
key: `text in${br}two lines`
})
+someMixin({
key: `text in<br/>two lines`
})
+someMixin({
key: 'text in<br/>two lines'
})
请告诉我这样做的可能性和正确的方法。谢谢!
Pug mixin旨在接受控制变量的属性和内容的块。您正在尝试将属性用于内容,这就是为什么您很难做到这一点。