goods-item.uvue 648 B

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