How to set selected select option in Handlebars template

前端 未结 17 2089
猫巷女王i
猫巷女王i 2020-12-12 12:55

With a Handlebars.js template like this...


    {{#select CurrentSort}}
    
    
    
    
    
    
    
    
    {{/select}}

You can tweak the helper to work even if you don't use the value attribute--just adjust the regexp to search the element text, and do the string replacement before the matched text.

提交回复
热议问题