84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
抱歉,着急用,我又来了。我想判断某个url({{vediourl}})是否包含.mp4 .ogg 应该怎么写? 应该是要写helper了?
多谢。
ringa_lee
Handlebars.registerHelper('isContain', function(url, options) { if (url.indexOf('.mp4')>=0 || url.indexOf('.ogg')>=0) { return options.fn(this); } return options.inverse(this); });
判断也可以用楼上的正则
使用就像这样
{{#isContain vediourl}} ... {{else}} ... {{/isContain }}
/\.mp4|\.ogg/.test(url)
判断也可以用楼上的正则
使用就像这样