当前位置:   article > 正文

uniapp组件-uni-badge数字角标

uni-badge

官方示例:https://ext.dcloud.net.cn/plugin?id=21

数字角标通用来标记重点信息使用,如接受到新消息、有未读消息等

效果图:

代码实现:

  1. <template>
  2. <view class="page">
  3. <uni-section title="有底色" type="line"></uni-section>
  4. <view style="background-color: white;padding: 20rpx;flex-direction: row;">
  5. <uni-badge text="1" />
  6. <uni-badge text="2" type="primary" />
  7. <uni-badge text="34" type="success" />
  8. <uni-badge text="45" type="warning" />
  9. <uni-badge text="123" type="error" />
  10. </view>
  11. <uni-section title="无底色" type="line"></uni-section>
  12. <view>
  13. <uni-badge :inverted="true" text="1" />
  14. <uni-badge :inverted="true" text="2" type="primary" />
  15. <uni-badge :inverted="true" text="34" type="success" />
  16. <uni-badge :inverted="true" text="45" type="warning" />
  17. <uni-badge :inverted="true" text="123" type="error" />
  18. </view>
  19. <uni-section title="迷你" type="line"></uni-section>
  20. <view>
  21. <uni-badge text="1" size="small" />
  22. <uni-badge text="2" type="primary" size="small" />
  23. <uni-badge text="34" type="success" size="small" />
  24. <uni-badge text="45" type="warning" size="small" />
  25. <uni-badge text="123" type="error" size="small" />
  26. </view>
  27. </view>
  28. </template>

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/503385
推荐阅读
相关标签