简体   繁体   English

无法在输入值内显示数据

[英]Can not display data inside input value

Am trying to display the value of my variable in a textBox using Jade but it is not working> I tried : value="#{startDate}" value="#{{startDate}}" value="{startDate}" value={{startDate}} 我正在尝试使用Jade在文本框中显示变量的值,但它不起作用>我尝试过: value="#{startDate}" value="#{{startDate}}" value="{startDate}" value={{startDate}}

knowing that it is working with placeHolder 知道它正在与placeHolder一起使用

You're referencing your startDate variable correctly by doing this in your jade view: 通过在玉视图中执行以下操作,可以正确引用startDate变量:

#{startDate}

... so that leaves the route: are you inserting the variable into the view correctly in the first place? ...这样就离开了路线:您是否首先将变量正确地插入到视图中? ie something like this (if using Express): 即这样的事情(如果使用Express的话):

router.get('/', function(req, res) {
  res.render('yourview', { startDate: someDateVariable });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM