SearchImage.vue 490 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <img v-lazy="imageInfo" alt="展示图" />
  3. </template>
  4. <script setup lang="ts">
  5. import { ref, PropType } from 'vue'
  6. import { ConfigType } from '@/packages/index.d'
  7. import { fetchImages } from '@/packages'
  8. const props = defineProps({
  9. item: {
  10. type: Object as PropType<ConfigType>,
  11. }
  12. })
  13. const imageInfo = ref('')
  14. // 获取图片
  15. const fetchImageUrl = async () => {
  16. imageInfo.value = await fetchImages(props.item)
  17. }
  18. fetchImageUrl()
  19. </script>
  20. <style scoped>
  21. </style>