university-item.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="px-30 py-20 flex items-center gap-20" @click="handleClick">
  3. <ie-image :src="data.logo" custom-class="w-110 h-110" mode="aspectFill" />
  4. <view class="flex-1 flex flex-col gap-8">
  5. <view class="text-30 text-fore-title font-bold flex items-center gap-20">
  6. <text class="flex-1 min-w-1 ellipsis-1">{{ data.name }}</text>
  7. <uv-tags v-if="data.star" type="warning" size="tiny" plain :text="data.star"></uv-tags>
  8. </view>
  9. <view class="flex items-center gap-10 flex-wrap">
  10. <view v-for="value in tags" :key="value">
  11. <uv-tags :text="value" type="info" size="tiny" plain />
  12. </view>
  13. </view>
  14. <view class="text-24 text-fore-light flex items-center gap-6">
  15. <uv-icon name="map" size="16" color="var(--fore-light)" />
  16. <text class="text-24 text-fore-light">{{ data.address }}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script lang="ts" setup>
  22. import { Major } from '@/types';
  23. const props = defineProps<{
  24. data: Major.University;
  25. }>();
  26. const tags = computed(() => {
  27. return props.data.bxLevel?.split(',') || [];
  28. });
  29. const emit = defineEmits<{
  30. (e: 'click', data: Major.University): void;
  31. }>();
  32. const handleClick = () => {
  33. emit('click', props.data);
  34. };
  35. </script>
  36. <style lang="scss" scoped></style>