| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <template>
- <view>
- <view class="row">
- <image class="image-item r-10 m-r20 m-b20" :style="[{width},{height}]" :src="item" mode="aspectFill"
- v-for="(item,index) in list" @click="onPreviewImage(index)"></image>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- is_both: {
- type: Boolean,
- default: false
- },
- width: {
- type: String,
- default: '160rpx'
- },
- height: {
- type: String,
- default: '90rpx'
- },
- list: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {}
- },
- methods: {
- onPreviewImage(index) {
- uni.previewImage({
- urls: this.list,
- current: index
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .image-item {
- display: block;
- }
- </style>
|