You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
635 B

6 months ago
  1. <template>
  2. <i :class="['iconfont',cname]" :style="'color:'+color+';font-size:'+fontSize" @tap="$emit('touch')"><slot></slot></i>
  3. </template>
  4. <script>
  5. export default {
  6. props: {
  7. cname: String,
  8. color: {
  9. type: String,
  10. default: '#BDC3C9'
  11. },
  12. size: {
  13. type: [Number, String],
  14. default: 30
  15. }
  16. },
  17. computed: {
  18. fontSize() {
  19. return isNaN(this.size) ? this.size : `${uni.upx2px(this.size)}px`
  20. }
  21. }
  22. }
  23. </script>
  24. <style lang="scss">
  25. //下载项目文件后直接替换,在iconfont.css字体文件路径前面加上'iconfont/',并删除font-size: 16px;
  26. @import "iconfont/iconfont.css";
  27. </style>