-
Notifications
You must be signed in to change notification settings - Fork 0
/
img-view
39 lines (39 loc) · 1 KB
/
img-view
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<div v-for="imgInfo in imgList" :key="imgInfo">
<div>
<span>{{ imgInfo.name }}</span>
<span>{{ imgInfo.size }}</span>
</div>
<el-image :src="imgInfo.url" lazy :preview-src-list="imgList.map(img=>img.url)"></el-image>
</div>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
el: '#app',
data: function () {
return {
imgList: [
{
name: "123",
size: "20MB",
url: "xxx"
},
]
}
}
})
</script>
</html>