V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
sox
V2EX  ›  分享创造

counting-stars: 星级评分 ☆

  •  
  •   sox ·
    egoist · 2015-12-07 20:00:50 +08:00 · 1426 次点击
    这是一个创建于 3226 天前的主题,其中的信息可能已经有所发展或是发生改变。

    GitHub

    // default settings
    { chars = ['★', '☆'],
      rating = 0,
      tag = 'span',
      attrs = {}
    } = {}
    // usage
    import countingStars from 'counting-stars';
    countingStars({
      rating: 4
    });
    // use your favorite chars
    countingStars({
      chars: [
        '<i class="fa fa-star"></i>',   // full star
        '<i class="fa fa-star-o"></i>', // half star
      ],
      rating: 3.5
    });
    // wrap star with tag and give it attributes
    countingStars({
      attrs: {
        'onClick': 'handleClick'
      },
      rating: 3.5
    });
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1158 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:25 · PVG 01:25 · LAX 10:25 · JFK 13:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.