Test.vue
1.86 KB
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
<template>
<a-select
v-model:value="value"
style="width: 120px"
mode="multiple"
:maxTagCount="1"
:options="showedProgressList"
>
<template #dropdownRender="{ menuNode: menu }">
<v-nodes :vnodes="menu"/>
<a-divider style="margin: 4px 0"/>
<div
@mousedown="e => e.preventDefault()"
>
<a-button type="link">全选</a-button>
<a-button type="link">全选</a-button>
</div>
</template>
</a-select>
</template>
<script>
import {PlusOutlined} from '@ant-design/icons-vue'
import {defineComponent, ref} from 'vue'
let index = 0
export default defineComponent({
components: {
PlusOutlined,
VNodes: (_, {attrs}) => {
return attrs.vnodes
},
},
setup() {
const items = ref(['jack', 'lucy'])
const value = ref('lucy')
const addItem = () => {
console.log('addItem')
items.value.push(`New item ${index++}`)
}
const showedProgressList = ref([])
const progressMap = {
mallcountData: "商场客流",
floorcountData: "楼层客流",
zonecountData: "店铺客流",
gatecountData: "监控点客流",
mallfaceSta: "商场人脸",
floorfaceSta: "楼层人脸",
zonefaceSta: "店铺人脸",
gatefaceSta: "监控点人脸"
}
for (const key in progressMap)
{
const value = progressMap[key]
showedProgressList.value.push(
{
value: key,
label: value,
}
)
}
return {
items,
value,
addItem,
showedProgressList,
}
},
})
</script>