cascader.vue
2.52 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
74
75
76
77
<template>
<div>
<Row>
<i-col span="18">
<i-button v-on:click="setValue">setValue</i-button>
</i-col>
<i-col span="4">
<Cascader :data="data" v-model="value1" transfer></Cascader>
</i-col>
</Row>
</div>
</template>
<script>
export default {
data () {
return {
value1: [],
data: [{
value: '9ecec83c-cf6b-4cfe-aa75-eb3510875331',
label: '北京',
children: [{
value: 'a873a9bd-7d75-4f46-9369-4d25a1feb13c',
label: '故宫'
}, {
value: 'tiantan',
label: '天坛'
}, {
value: 'wangfujing',
label: '王府井'
}]
}, {
value: 'ca7c0fbc-728d-42e8-b111-f5f73cf9171b',
label: '江苏',
children: [{
value: 'a89d891b-5c50-44c0-87b4-d4f934edc921',
label: '南京',
children: [{
value: '44736384-0ede-41ba-bf7a-59c84241851a',
label: '夫子庙中国第一庙来自南京',
children:[{
value: '44736384-0ede-41ba-bf7a-59c84241851c',
label:'自定义产品系统来自黑龙江地区'
}]
}]
}, {
value: 'suzhou',
label: '苏州',
children: [{
value: 'zhuozhengyuan',
label: '拙政园',
}, {
value: 'shizilin',
label: '狮子林',
}]
}],
}]
}
},
methods: {
setValue() {
var v = "ca7c0fbc-728d-42e8-b111-f5f73cf9171b,a89d891b-5c50-44c0-87b4-d4f934edc921,44736384-0ede-41ba-bf7a-59c84241851a";
var x = v.split(',')
var x1 = x[0].toString();
var x2 = x[1].toString();
var x3 = x[2].toString();
this.value1 = x;
}
},
mounted () {
}
}
</script>
<style>
</style>