12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <template>
- <view class="img-box">
- <view class="img-item" v-for="(fileItem,fileIndex) in fileList">
- <image @click.stop="previewImage(fileIndex)" :src="fileItem" mode="aspectFill"></image>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "img-two",
- components: {},
- props: {
- fileList:{
- default:[]
- }
- },
- data() {
- return {}
- },
- watch: {},
- mounted() {
- },
- methods: {
- previewImage(index){
- uni.previewImage({
- urls: this.fileList,
- current:index
- });
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .img-box{
- height: auto;
- display: flex;
- flex-wrap: wrap;
- .img-item{
- display: inline-block;
- margin-right:12rpx;
- image{
- width: calc((100vw - 200rpx)/2);
- height: calc((100vw - 200rpx)/2);
- border-radius: 16rpx;
- }
- }
- .img-item:nth-of-type(even){
- margin-right:0;
- }
- .img-item:nth-of-type(n+3){
- margin-top:10rpx;
- }
- }
- </style>
|