最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Pug - generating Select and Options - Stack Overflow

programmeradmin1浏览0评论

I am new to Pug and I am trying to generate a Select set of Options like this:

select
each variable in variables
option(value=variable.id) #{variable.var_name}

However the result I get, in the rendered page, is an empty select input followed by the list of options as text

I am new to Pug and I am trying to generate a Select set of Options like this:

select
each variable in variables
option(value=variable.id) #{variable.var_name}

However the result I get, in the rendered page, is an empty select input followed by the list of options as text

Share Improve this question edited Oct 25, 2016 at 5:26 Andrea Sindico asked Oct 24, 2016 at 19:44 Andrea SindicoAndrea Sindico 7,4407 gold badges49 silver badges87 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

Indents the code https://pugjs.org/language/iteration.html

select
  each variable in variables
    option(value=variable.id) #{variable.var_name}
发布评论

评论列表(0)

  1. 暂无评论