goods-item.uvue 611 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <view class="w-full p-3 bg-white rounded-xl mb-3 dark:bg-surface-800">
  3. <cl-image :src="item.image" mode="widthFix" width="100%" height="250rpx"></cl-image>
  4. <cl-text :pt="{ className: 'mt-2' }">{{ item.title }}</cl-text>
  5. </view>
  6. </template>
  7. <script lang="ts" setup>
  8. import { computed, type PropType } from "vue";
  9. import { useParent } from "@/cool";
  10. defineOptions({
  11. name: "goods-item"
  12. });
  13. type GoodsItem = {
  14. id: number;
  15. likeCount: number;
  16. title: string;
  17. image: string;
  18. };
  19. const props = defineProps({
  20. item: {
  21. type: Object as PropType<GoodsItem>,
  22. default: () => ({})
  23. }
  24. });
  25. </script>