-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.vue
59 lines (55 loc) · 1.04 KB
/
App.vue
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
<template>
<DxTagBox
id="tagBox"
:data-source="dataSource"
value-expr="ID"
display-expr="Name"
:search-enabled="true"
:show-selection-controls="true"
:grouped="true"
:multiline="true"
:max-displayed-tags="6"
label="Products"
label-mode="floating"
@value-changed="onValueChanged"
:drop-down-options="dropDownOptions"
/>
</template>
<script>
import 'devextreme/dist/css/dx.light.css';
import { DxTagBox } from 'devextreme-vue';
import DataSource from 'devextreme/data/data_source';
import { data } from './data';
export default {
name: 'App',
components: {
DxTagBox
},
data() {
return {
dataSource: new DataSource({
store: {
data: data,
type: 'array',
key: 'ID'
},
group: 'Category'
}),
dropDownOptions: {
height: 300
}
};
},
methods: {
onValueChanged(e) {
console.log(e.previousValue);
console.log(e.value);
}
}
};
</script>
<style>
#tagBox {
width: 500px;
}
</style>