Blame view

examples/routers/select.vue 5.99 KB
219e5c92   梁灏   fixed #957
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
97
98
99
100
101
102
103
104
105
106
107
  <!--<template>-->
      <!--<Row>-->
          <!--<i-col span="4">{{model}}</i-col>-->
          <!--<i-col span="8">-->
              <!--<i-select v-model="model" :label="['L Alabama', 'L Hawaii']" multiple @input="handleInput" filterable remote :remote-method="remoteMethod" :loading="loading" clearable>-->
                  <!--<i-option v-for="option in options" :value="option.value" :key="new Date()">{{option.label}}</i-option>-->
              <!--</i-select>-->
          <!--</i-col>-->
      <!--</Row>-->
  <!--</template>-->
  
  <!--<script>-->
      <!--export default {-->
          <!--data () {-->
              <!--return {-->
  <!--//                model: 'Alabama',-->
                  <!--model: ['Alabama', 'Hawaii'],-->
                  <!--options: [-->
  
                  <!--],-->
                  <!--list: [],-->
                  <!--loading: false,-->
                  <!--states: ["Al", "Alabama", "Alaska", "Arizona",-->
                      <!--"Arkansas", "California", "Colorado",-->
                      <!--"Connecticut", "Delaware", "Florida",-->
                      <!--"Georgia", "Hawaii", "Idaho", "Illinois",-->
                      <!--"Indiana", "Iowa", "Kansas", "Kentucky",-->
                      <!--"Louisiana", "Maine", "Maryland",-->
                      <!--"Massachusetts", "Michigan", "Minnesota",-->
                      <!--"Mississippi", "Missouri", "Montana",-->
                      <!--"Nebraska", "Nevada", "New Hampshire",-->
                      <!--"New Jersey", "New Mexico", "New York",-->
                      <!--"North Carolina", "North Dakota", "Ohio",-->
                      <!--"Oklahoma", "Oregon", "Pennsylvania",-->
                      <!--"Rhode Island", "South Carolina",-->
                      <!--"South Dakota", "Tennessee", "Texas",-->
                      <!--"Utah", "Vermont", "Virginia",-->
                      <!--"Washington", "West Virginia", "Wisconsin",-->
                      <!--"Wyoming"]-->
              <!--}-->
          <!--},-->
          <!--mounted () {-->
              <!--this.options = [-->
  <!--//                {-->
  <!--//                    label: '全部',-->
  <!--//                    value: 0-->
  <!--//                },{-->
  <!--//                    label: '苹果',-->
  <!--//                    value: 1-->
  <!--//                },{-->
  <!--//                    label: '香蕉',-->
  <!--//                    value: 2-->
  <!--//                },{-->
  <!--//                    label: '西瓜',-->
  <!--//                    value: 3-->
  <!--//                }-->
              <!--];-->
          <!--},-->
          <!--methods: {-->
              <!--handleAdd () {-->
                  <!--this.options = [-->
                      <!--{-->
                          <!--label: '全部',-->
                          <!--value: 0-->
                      <!--},{-->
                          <!--label: '苹果',-->
                          <!--value: 1-->
                      <!--},{-->
                          <!--label: '香蕉',-->
                          <!--value: 2-->
                      <!--},{-->
                          <!--label: '西瓜',-->
                          <!--value: 3-->
                      <!--}-->
                  <!--]-->
              <!--},-->
              <!--remoteMethod (query) {-->
                  <!--console.log(13)-->
                  <!--if (query !== '') {-->
                      <!--this.loading = true;-->
                      <!--setTimeout(() => {-->
                          <!--this.loading = false;-->
                          <!--this.options = this.list.filter(item => {-->
                              <!--return item.label.toLowerCase()-->
                                      <!--.indexOf(query.toLowerCase()) > -1;-->
                          <!--});-->
                      <!--}, 500);-->
                  <!--} else {-->
                      <!--this.options = [];-->
                  <!--}-->
              <!--},-->
              <!--handleInput () {-->
  <!--//                console.log(1)-->
              <!--}-->
          <!--},-->
          <!--mounted () {-->
              <!--this.list = this.states.map(item => {-->
                  <!--return {-->
                      <!--value: item,-->
                      <!--label: 'L ' + item-->
                  <!--};-->
              <!--});-->
          <!--}-->
      <!--}-->
  <!--</script>-->
  
  
e355dd49   梁灏   add Select Component
108
  <template>
219e5c92   梁灏   fixed #957
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
      <div>
          <Row style="width: 400px;">
              <i-col span="12" style="padding-right:10px">
                  <Select v-model="model11" filterable>
                      <Option v-for="item in cityList" :value="item.value" :key="item">{{ item.label }}</Option>
                  </Select>
              </i-col>
              <i-col span="12">
                  <Select v-model="model12" filterable multiple>
                      <Option v-for="item in cityList" :value="item.value" :key="item">{{ item.label }}</Option>
                  </Select>
              </i-col>
          </Row>
          <Button @click="handleSet">set</Button>
      </div>
e355dd49   梁灏   add Select Component
124
  </template>
e355dd49   梁灏   add Select Component
125
  <script>
e355dd49   梁灏   add Select Component
126
      export default {
e355dd49   梁灏   add Select Component
127
128
          data () {
              return {
219e5c92   梁灏   fixed #957
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
                  cityList: [
                      {
                          value: 'beijing',
                          label: '北京市'
                      },
                      {
                          value: 'shanghai',
                          label: '上海市'
                      },
                      {
                          value: 'shenzhen',
                          label: '深圳市'
                      },
                      {
                          value: 'hangzhou',
                          label: '杭州市'
                      },
                      {
                          value: 'nanjing',
                          label: '南京市'
                      },
                      {
                          value: 'chongqing',
                          label: '重庆市'
                      }
01b54e30   梁灏   Select support re...
154
                  ],
219e5c92   梁灏   fixed #957
155
156
                  model11: '',
                  model12: []
01b54e30   梁灏   Select support re...
157
158
              }
          },
01b54e30   梁灏   Select support re...
159
          methods: {
219e5c92   梁灏   fixed #957
160
161
162
              handleSet () {
                  this.model11 = 'shanghai';
  //                this.model12 = ['beijing'];
e355dd49   梁灏   add Select Component
163
              }
e355dd49   梁灏   add Select Component
164
165
          }
      }
219e5c92   梁灏   fixed #957
166
  </script>