cwg-icon.vue 647 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <SvgIcon :color="color" :icon="props.name || props.icon" class="icon" :height="size" :width="size" />
  3. </template>
  4. <script setup>
  5. import SvgIcon from "@/uni_modules/cwg-svg-icon/components/cwg-svg-icon/cwg-svg-icon.vue";
  6. import {
  7. ref,
  8. watch
  9. } from "vue";
  10. const props = defineProps({
  11. name: {
  12. type: String,
  13. required: ""
  14. }, // 图标名
  15. icon: {
  16. type: String,
  17. required: ""
  18. }, // 图标名
  19. size: {
  20. type: [Number, String],
  21. default: 24
  22. },
  23. color: {
  24. type: String,
  25. default: ""
  26. },
  27. });
  28. </script>
  29. <style scoped>
  30. .icon {
  31. display: inline-flex;
  32. align-items: center;
  33. justify-content: center;
  34. color: inherit;
  35. }
  36. </style>