Long block of text in Jade textarea?

给你一囗甜甜゛ 提交于 2019-12-05 00:09:29
textarea(id="theTextarea")
  | Hello 
  | world.
  | Hello
  | moon.
  | Hello
  | sun.

The | worked great for me. In my case though, I needed to get the value from a js variable (passed via render local variables). This is what I ended up with:

textarea#resp( name="resp", rows="6", cols="66" )
  | #{respStr}

I hope that helps someone.

You can also do this, if you don't want a lot of pipes "clogging up" your markup (notice the dot character after the closing parens):

textarea(id="theTextarea").
  Hello
  world.
  Hello
  moon.
  Hello
  sun.

Read through the Tag Text section in the Jade docs for more information.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!