tagView.vue 947 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <script setup lang="ts">
  2. import { computed } from 'vue';
  3. const props = defineProps({
  4. sid: { type: String },
  5. url: { type: String },
  6. title: { type: String, default: '' },
  7. content: { type: String, default: '' },
  8. icon: { type: String, default: '' },
  9. });
  10. const backgroundURL = computed(
  11. () => props.url && props.url + '&x-oss-process=image/resize,m_fill,w_80,h_80',
  12. );
  13. </script>
  14. <template>
  15. <span
  16. class="tag-icon animate"
  17. :style="{
  18. backgroundImage: `url(${icon})`,
  19. }"
  20. ></span>
  21. <div class="tag-body">
  22. <div data-id="${data.sid}" class="tag-commodity">
  23. <div
  24. :style="{
  25. backgroundImage: `url(${backgroundURL})`,
  26. }"
  27. class="tag-avatar"
  28. ></div>
  29. <p class="tag-title">{{ title }}</p>
  30. <div class="tag-info">
  31. <div>{{ content.substring(0, 30) }}</div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>