<u-image @click="imgClick(imgSrc)" :src="imgSrc">
</u-image>
<script>
// https://ext.dcloud.net.cn/plugin?id=123 图片预览插件安装地址
import {
pathToBase64,
base64ToPath
} from '../../js_sdk/mmmm-image-tools/index.js'
export default {
methods: {
imgClick(url) {
// // 预览图片
// uni.previewImage({
// urls: [url]
// });
//预览图片
uni.showLoading({
title: '预览加载中'
});
let imgsArray = [];
//_this.img_所要预览的base64图片路径
base64ToPath(url).then(path => {
uni.hideLoading();
imgsArray[0] = path
uni.previewImage({
current: 0,
urls: imgsArray
})
})
}
}
}
</script>
04-25
671
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-15
232
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-06
448
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-06