0

私がやりたいことは次のとおりです。

%input.current-page( type="text" value=currentPageNum )

currentPageNumは動的です

それが私がこのテンプレートを呼び出す方法です:

@$el.html( Haml.render( @template, { locals: { currentPageNum: @currentPageNum } } ) )

この質問はhaml.jsに関するものですが、ここで新しいタグを作成するのに十分な評判がありません

4

1 に答える 1

2

私は答えを見つけました:

%input.current-page{ type: "text", value: "#{currentPageNum}" }

参考文献:

https://github.com/creationix/haml-js/blob/master/test/embedded_code.haml

との比較

https://github.com/creationix/haml-js/blob/master/test/embedded_code.html

于 2012-05-31T13:30:33.933 に答える