如何解决DOM未更新如果handlebarsJS中的初始状态为false,如何在{{#IF}}语句中使用嵌套的{{#EACH}}?
我有一个带有下拉列表的表单,该表单基于变量 import sympy
sum=0
lst1=[]
for num in range(1,1000):
#isprime(n):return True when the num is prime and false when the num is composite
if sympy.isprime(num) is True:
sum+=num
lst1.append(sum)
print("The sum list 1 is: ",lst1)
lst2=[]
for sum in lst1:
if sum<1000:
if sympy.isprime(sum)==True:
lst2.append(sum)
print("The list 2 is: ",lst2)
print("The required answer is :",max(lst2))
隐藏-我遇到了DOM问题,其中存在数据,但新显示的元素无法访问它。
当我选择高级搜索时,我只想看到下拉菜单,但是没有填充选项-是否有mode
之类的仍在DOM上但被隐藏的有角度的hide/show
?
车把助手:
advancedSearch: (mode,options) => {
console.log('MODE: ',mode)
return mode !== 'advanced' ? '' : options.fn();
}
视图:
{{#advancedSearch mode}}
<div class="input-group select-full">
<label for='location'>Location</label>
<select id='location' name="location" class="input-box">
<option value='' selected='true'>Location</option>
{{#each locations}}
<option value="{{DropDownValue}}">{{DropDownValue}}</option>
{{/each}}
</select>
</div>
...
{{/advancedSearch}}
获取数据的功能位于根路由上
let locations = {}
router.get('/',async (req,res) => {
let { mode } = req.query;
if (mode) {
XRef_OfficeLocations.findAll().then((list) => {
console.log('got XRef_Locations...',list.length)
locations = list;
res.render('directory',{ mode,departments,locations })
}).catch((e) => console.log(e))
} else {
res.render('directory',{ departments,locations })
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。