How to set selected select option in Handlebars template

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

With a Handlebars.js template like this...

').html( options.fn(this) );
        $el.find('[value="' + value + '"]').attr({'selected':'selected'});
        return $el.html();
    });

You can wrap selects in your Handlebars template with {{#select status}}...


and end up with this...


Presto!

提交回复
热议问题