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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
| <template>
| <div class="v-data-board-table">
| <div class="_head" :style="{height: columnHeight + 'px'}">
| <div
| v-for="(item, index) in columnName"
| :key="index"
| :class="{'t-center flex-1': index == 1, '_head-3': index == 2, '_head-1': index == 0}"
| :style="index == 2 && lastWidth ? `width: ${lastWidth}px` : ''"
| >
| {{item}}
| </div>
| </div>
| <div v-if="isRoll">
| <v-roll-list
| v-if="data.length > 0"
| :data="data"
| :height="height"
| :column-height="columnHeight"
| :wait-time="2000"
| >
| <template #default="{ row, index }">
| <Item :item="row" :lastWidth="lastWidth" :index="index" :rank="index+Number(initial)" />
| </template>
| </v-roll-list>
| </div>
| <div v-else :style="{height}" style="overflow:auto">
| <div v-for="(item, index) in data" :key="`item_${index}`">
| <Item :item="item" :lastWidth="lastWidth" :index="index" :height="columnHeight" :rank="index+Number(initial)" />
| </div>
|
| </div>
|
| </div>
| </template>
|
| <script>
| import Item from './item';
| export default {
| name: 'vueName',
| components:{ Item },
| props: {
| lastWidth: Number,
| columnName: {
| type: Array,
| default: []
| },
| columnHeight: {
| type: Number,
| default: 28
| },
| height: {
| type: String,
| default: '15vh'
| },
| data: {
| type: Array,
| default: []
| },
| isRoll: {
| type: Boolean,
| default: true
| },
| initial: {
| type: Number,
| default: 0
| },
| },
| data () {
| return {
| msg:'Welcome to your vueName'
| }
| }
| }
| </script>
|
| <style lang="less">
| .v-data-board-table {
| ._head {
| display: flex;
| color: #fff;
| align-items: center;
| padding-left: 20px;
| margin: 8px 0;
| background: rgba(115,172,230,0.2)
| }
| ._head-1 {
| width: 30px;
|
| }
| ._head-3 {
| text-align: center;
| }
|
| }
|
| </style>
|
|