ModuleIcon.vue 727 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="module-icon" :style="iconStyle">
  3. <text>{{ icon }}</text>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: "HrModuleIcon",
  9. props: {
  10. icon: { type: String, default: "" },
  11. color: { type: String, default: "#157a2c" },
  12. soft: { type: Boolean, default: false },
  13. },
  14. computed: {
  15. iconStyle() {
  16. return {
  17. backgroundColor: this.soft ? this.color + "18" : this.color,
  18. color: this.soft ? this.color : "#fff",
  19. };
  20. },
  21. },
  22. };
  23. </script>
  24. <style scoped lang="scss">
  25. .module-icon {
  26. width: 82rpx;
  27. height: 82rpx;
  28. border-radius: 20rpx;
  29. display: flex;
  30. align-items: center;
  31. justify-content: center;
  32. font-size: 31rpx;
  33. font-weight: 600;
  34. }
  35. </style>