<template>
  <view class="image-list">
    <image 
      class="p-image-item" 
      :src="item" 
      :key="key"
      v-for="(item, key) in urls"
      mode="widthFix" 
      @tap="preview(item)"
    >
    </image>
  </view>
</template>

<script lang="ts" setup>
  import { previewImage } from "@tarojs/taro";
  import { defineProps } from "vue";

  const { urls } = defineProps<{urls: string[]}>();

  const preview = (url: string) => {
    previewImage({
      urls,
      current: url
    })
  }
</script>

<style lang="less">
  .p-image-item{
    width: 120px;
    height: 120px;
    margin: 10px;
    border-radius: 10px;
    background: #999;
  }
</style>