//摇树优化预览就不正常了
//"optimization": {
//"treeShaking": {
//"enable": true
//}
<template>
<view>
<block v-for="(url, index) in testUrls"><image :src="url" @tap="test(url)" mode=""></image></block>
</view>
</template>
<script>
export default {
data() {
return {
testUrls: [
'https://gry-sz.oss-cn-shenzhen.aliyuncs.com/6d5abecfd8ed4c2f881e0ed5675b26d9.jpg',
'https://gry-sz.oss-cn-shenzhen.aliyuncs.com/6a1e3453f43349ae9ef4c477c19ffd93.jpg',
'https://gry-sz.oss-cn-shenzhen.aliyuncs.com/6a1e3453f43349ae9ef4c477c19ffd93.jpg'
]
};
},
methods: {
test(url) {
uni.previewImage({
urls: this.testUrls,
current: url
});
}
}
};
</script>
f***@126.com (作者)
代码就一个图片预览的 demo
2019-09-09 11:26