jade 模板引擎带有按钮的 href 标签
jade template engine a href tag with button
如何在 Jade 模板中 link 一个按钮?我正在尝试生成 HTML
<a href="create"><button type="button">create new post</button></a>
我试过了
a(href="create") button "create new post"
结果是
<a href="create">button "create new post"</a>
如果我把它改成
a(href="create")button "create new post"
我收到错误
logJs\views\posts\update.jade:7 5| block content 6| h1='creating new post' > 7| a(href="create")button "hello word" 8| form(name="add-post",method="post") 9| div.input 10| span.label title Unexpected token `tag` expected `text`, `code`, `:`, `newline` or `eos`
您只需要使用单独的行和正确的缩进。玉码
a(href="create")
button(type="button") create new post
结果
<a href="create"><button type="button">create new post</button></a>
另一种解决方案:
a(href="create"): button(type="button") create new post
它对你也有用!
如何在 Jade 模板中 link 一个按钮?我正在尝试生成 HTML
<a href="create"><button type="button">create new post</button></a>
我试过了
a(href="create") button "create new post"
结果是
<a href="create">button "create new post"</a>
如果我把它改成
a(href="create")button "create new post"
我收到错误
logJs\views\posts\update.jade:7 5| block content 6| h1='creating new post' > 7| a(href="create")button "hello word" 8| form(name="add-post",method="post") 9| div.input 10| span.label title Unexpected token `tag` expected `text`, `code`, `:`, `newline` or `eos`
您只需要使用单独的行和正确的缩进。玉码
a(href="create")
button(type="button") create new post
结果
<a href="create"><button type="button">create new post</button></a>
另一种解决方案:
a(href="create"): button(type="button") create new post
它对你也有用!