<template>
<view class="content">
<view class="text-c" v-for="(item,index) in list" :key="index">
<view class="title">{{item.title}}</view>
<view class="tiem">
<view>{{item.name}}</view>
<view>{{item.tiem}}</view>
</view>
<view class="texts">{{item.content}}</view>
<view class="img" v-for="(img, i) in item.images" :key="i">
<image :src="img" mode="widthFix" @tap="previewOpen($event, item.images)" :data-src="img"></image>
</view>
</view>
<previewImage ref="previewImage" :imgs="imgs" ></previewImage>
</view>
</template>
<script>
import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
export default {
components: {
previewImage
},
data() {
return {
list:[
{
title:'【放假通知】2022年1壹号开始放假,1到3号放假!',
name:'徐大少爷',
tiem:'2021-12-30',
content: '山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。苔痕上阶绿,草色入帘青。谈笑有鸿儒,往来无白丁。可以调素琴,阅金经。无丝竹之乱耳,无案牍之劳形。南阳诸葛庐,西蜀子云亭。孔子云:何陋之有?西蜀子云亭。孔子云:何陋之有',
images:[
'http://www.0898uf.com/upload/image/20201226/1608947177502884.jpg',
'http://www.0898uf.com/upload/image/20201217/1608169686575395.jpg'
]
},
],
imgs:[],
};
},
onLoad() {
},
methods:{
previewOpen(e, imgs,index) {
this.imgs = imgs
this.imgs.unshift(this.imgs.splice(index, 1))
var param = e.currentTarget.dataset.src
this.$refs.previewImage.open(param); // 传入当前选中的图片地址或序号
},
}
}
</script>
<style lang="scss" scoped>
</style>