Blame view

examples/routers/cascader.vue 2.52 KB
47a7f21d   梁灏   support Cascader
1
  <template>
c736b0f1   梁灏   fix #4189
2
3
4
5
6
7
8
9
10
11
      <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>
0a48ac45   梁灏   Input add readonl...
12
13
  </template>
  <script>
0a48ac45   梁灏   Input add readonl...
14
      export default {
0a48ac45   梁灏   Input add readonl...
15
16
          data () {
              return {
c736b0f1   梁灏   fix #4189
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
                  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: '狮子林',
                          }]
                      }],
                  }]
207d6b07   梁灏   update Cascader I...
57
58
59
              }
          },
          methods: {
c736b0f1   梁灏   fix #4189
60
61
62
63
64
65
66
67
              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;
47dc36c5   梁灏   fixed Cascader st...
68
              }
c736b0f1   梁灏   fix #4189
69
70
71
          },
          mounted () {
  
0a48ac45   梁灏   Input add readonl...
72
73
          }
      }
c9433dcc   梁灏   optimize Timeline...
74
  </script>
c736b0f1   梁灏   fix #4189
75
76
77
  <style>
  
  </style>