2016-03-26 7 views
3

jadeテンプレートのボタンをリンクするにはどうすればいいですか?私はjadeテンプレートエンジンボタン付きhrefタグ

a(href="create")button "create new post" 

に変更した場合、私はエラーを取得する

<a href="create">button "create new post"</a> 

になり

a(href="create") button "create new post" 

を試みたHTML

<a href="create"><button type="button">create new post</button></a> 

を生成しようとしています

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` 

答えて

7

あなたはちょうど別の行と正しい字下げを使用する必要があります。ヒスイコード

a(href="create") 
    button(type="button") create new post 

<a href="create"><button type="button">create new post</button></a> 
で結果
+0

ありがとうございました。出来た – Arash

2

もう一つの解決策:

a(href="create"): button(type="button") create new post 

それはあまりにもあなたのために動作します!