Commit 54a83aa565401e1ff38d846d42b023138401c308
1 parent
6831b361
fixed #211
fixed #211
Showing
2 changed files
with
16 additions
and
59 deletions
Show diff stats
src/components/select/option.vue
test/routers/select.vue
1 | 1 | <template> |
2 | - <i-button type="primary" @click="modal1 = true">i-selelct加入width样式</i-button> | |
3 | - <i-button type="primary" @click="modal2 = true">i-selelct没有加入width样式</i-button> | |
4 | - | |
5 | - <Modal | |
6 | - :visible.sync="modal1" | |
7 | - title="普通的Modal对话框标题"> | |
8 | - <i-select :model.sync="model1" :style="modalStyle"> | |
9 | - <i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option> | |
10 | - </i-select> | |
11 | - </Modal> | |
12 | - | |
13 | - <Modal | |
14 | - :visible.sync="modal2" | |
15 | - title="普通的Modal对话框标题"> | |
16 | - <i-select :model.sync="model1" :style="modalStyle"> | |
17 | - <i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option> | |
18 | - </i-select> | |
19 | - </Modal> | |
2 | + <i-select :model.sync="model9" style="width:200px"> | |
3 | + <i-option value="beijing" label="北京市"> | |
4 | + <span>北京</span> | |
5 | + <span style="float:right;color:#ccc">Beiing</span> | |
6 | + </i-option> | |
7 | + <i-option value="shanghai" label="上海市"> | |
8 | + <span>上海</span> | |
9 | + <span style="float:right;color:#ccc">ShangHai</span> | |
10 | + </i-option> | |
11 | + <i-option value="shenzhen" label="深圳市"> | |
12 | + <span>深圳</span> | |
13 | + <span style="float:right;color:#ccc">ShenZhen</span> | |
14 | + </i-option> | |
15 | + </i-select> | |
20 | 16 | </template> |
21 | 17 | <script> |
22 | 18 | export default { |
23 | 19 | data () { |
24 | 20 | return { |
25 | - modal1: false, | |
26 | - modal2: false, | |
27 | - modalStyle: '', | |
28 | - cityList: [ | |
29 | - { | |
30 | - value: 'beijing', | |
31 | - label: '北京市' | |
32 | - }, | |
33 | - { | |
34 | - value: 'shanghai', | |
35 | - label: '上海市' | |
36 | - }, | |
37 | - { | |
38 | - value: 'shenzhen', | |
39 | - label: '深圳市' | |
40 | - }, | |
41 | - { | |
42 | - value: 'hangzhou', | |
43 | - label: '杭州市' | |
44 | - }, | |
45 | - { | |
46 | - value: 'nanjing', | |
47 | - label: '南京市' | |
48 | - }, | |
49 | - { | |
50 | - value: 'chongqing', | |
51 | - label: '重庆市' | |
52 | - } | |
53 | - ], | |
54 | - model1: '' | |
55 | - } | |
56 | - }, | |
57 | - computed: { | |
58 | - modalStyle: function(){ | |
59 | - let s = "" | |
60 | - if (this.modal1) | |
61 | - s = "width: 200px" | |
62 | - if (this.modal2) | |
63 | - s = "" | |
64 | - return s | |
21 | + model9: 'shanghai' | |
65 | 22 | } |
66 | 23 | } |
67 | 24 | } | ... | ... |