column.vue
991 Bytes
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
<template>
<div v-if="flex" class="tree-column" :class="{border: border!== undefined}" :style="{ width: width + 'px', flex: flex}">
<slot></slot>
</div>
<div v-else class="tree-column" :class="{border: border!== undefined}" :style="{ width: width + 'px'}">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'Column',
props: {
width: Number,
field: String,
label: String,
flex: Number,
border: String
},
data() {
return {
open: false
}
},
mounted() {
}
}
</script>
<style lang="scss">
.tree-column{
position: relative;
padding: 12px 35px 13px;
min-width: 60px;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
box-sizing: border-box;
&.border{
// border-right: 1px solid #eee;
}
}
.resize-line{
position: absolute;
top: 0;
right: -3px;
width:6px;
height: 100%;
cursor: col-resize;
}
</style>