Rate

评分组件。

使用

  1. <h3>Simple</h3>
  2. <m-rate total="5" value="1" color='#0072d9'></m-rate>
  3. <h3>With Event</h3>
  4. <m-rate id="myRate" total="5" value="2" color='#f57c00'></m-rate>
  5. <h3>Half</h3>
  6. <m-rate total="5" half value="3" color='red'></m-rate>
  7. <script src="https://tencent.github.io/omi/packages/omi/dist/omi.js"></script>
  8. <script src="../../src/rate/index.js"></script>
  9. <script>
  10. document.querySelector("#myRate").addEventListener('selected', function (evt) {
  11. console.log(evt.detail)
  12. })
  13. </script>

API

Props

  1. {
  2. total: number
  3. half?: boolean
  4. value?: number
  5. color?: string
  6. }