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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
<div class="explorer">
<div class="explorer-item" v-for="item in data" :key="item.alias" @click="onNameClick(item)">
<i v-if="item.dirtype" class="matter-icon el-icon-folder" style="color: #ffc402"></i>
<i v-else :class="`iconfont ${type2icon(item.type)}`"></i>
<p>{{ item.name }}</p>
</div>
</div>
</template>
<script>
import mixin from "./mixin";
export default {
mixins: [mixin],
data() {
return {};
},
methods: {
onSelectionChange(selection) {
this.$emit("selection-change", selection);
},
onSelectable(row) {
if (!row.dirtype) return true;
},
handleCommand(command) {
command.action(command.row);
},
onScrollEnd() {
this.$emit("scroll-end")
},
},
};
</script>
<style scoped>
.explorer {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
}
.explorer-item {
width: 80px;
padding: 15px;
text-align: center;
cursor: pointer;
}
.explorer-item:hover {
background: #f0f6fd;
border-radius: 5px;
}
.explorer-item i {
font-size: 55px;
}
.explorer-item p {
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>s