jin-icons.vue 847 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <view class="content">
  3. <view class="icon" :style="{color: color, fontSize: fontSize}" v-html="type" @click="toclick"></view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. type: {
  10. type: String,
  11. default: '&#xe644;'
  12. },
  13. color: {
  14. type: String,
  15. default: '#666666'
  16. },
  17. fontSize: {
  18. type: String,
  19. default: '34rpx'
  20. }
  21. },
  22. methods: {
  23. toclick() {
  24. this.$emit('click');
  25. }
  26. }
  27. }
  28. </script>
  29. <style scoped>
  30. .content{
  31. display: flex;
  32. align-items: center;
  33. justify-content: center;
  34. }
  35. @font-face {
  36. font-family: 'jin';
  37. /** 阿里巴巴矢量图标库的字体库地址,可以替换自己的字体库地址 **/
  38. src: url('https://at.alicdn.com/t/font_1491431_6m7ltjo8wi.ttf') format('truetype');
  39. }
  40. .icon {
  41. font-family: jin !important;
  42. font-size: 34rpx;
  43. }
  44. </style>