DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

使用星星图标获取用户评分


使用一个数组,评分为3对应着:

html:

{{#each rankicons}}
  <span class="glyphicon {{.}} text-danger"></span>
{{/each}}

js:

Template.UserEvaluations.helpers({
  rankicons: function() {
    return ['glyphicon-star', 'glyphicon-star', 'glyphicon-star', 'glyphicon-star-empty', 'glyphicon-star-empty'];
  }
});

Ref:

http://stackoverflow.com/questions/14189672/meteor-iterate-list-in-template



Published

Feb 13, 2015

Last Updated

Feb 13, 2015

Category

Tech

Tags

  • bootstrap 4
  • glyphicon 1
  • meteor 47

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor