pv-icon.vue 657 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <!-- 图标icon组件 -->
  3. <text class='iconfont pv-icon' :class="name" @click="iconClick"
  4. :style="[{color: color, fontSize: fontSize}, customStyle]"></text>
  5. </template>
  6. <script>
  7. export default {
  8. name: "pv-icon",
  9. props: {
  10. name: String,
  11. customStyle: Object, // 自定义样式
  12. color: {
  13. type: String,
  14. default: '#152129'
  15. },
  16. fontSize: {
  17. type: String,
  18. default: '24rpx'
  19. }
  20. },
  21. data() {
  22. return {
  23. }
  24. },
  25. methods: {
  26. iconClick() {
  27. this.$emit('click')
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .pv-icon {
  34. line-height: inherit;
  35. position: relative;
  36. top: 0rpx;
  37. left: 0;
  38. }
  39. </style>