Blame view

test/routers/button.vue 4.3 KB
7fa943eb   梁灏   init
1
  <template>
d6342fe1   jingsam   fixed ie bug
2
3
4
      <i-button>Default</i-button>
      <i-button type="primary">Primary</i-button>
      <i-button type="ghost">Ghost</i-button>
e1596b7e   梁灏   add Button UI
5
      <br><br>
d6342fe1   jingsam   fixed ie bug
6
7
8
      <i-button type="primary" size="large">Large</i-button>
      <i-button type="primary">Default</i-button>
      <i-button type="primary" size="small">Small</i-button>
e1596b7e   梁灏   add Button UI
9
      <br><br>
d6342fe1   jingsam   fixed ie bug
10
11
      <i-button>Default</i-button>
      <i-button disabled>Default(Disabled)</i-button>
e1596b7e   梁灏   add Button UI
12
      <br><br>
d6342fe1   jingsam   fixed ie bug
13
14
      <i-button type="primary">Primary</i-button>
      <i-button type="primary" disabled>Primary(Disabled)</i-button>
e1596b7e   梁灏   add Button UI
15
      <br><br>
d6342fe1   jingsam   fixed ie bug
16
17
      <i-button type="ghost">Ghost</i-button>
      <i-button type="ghost" disabled>Ghost(Disabled)</i-button>
e1596b7e   梁灏   add Button UI
18
      <br><br>
d6342fe1   jingsam   fixed ie bug
19
20
      <i-button type="primary" shape="circle" icon="ios-search"></i-button>
      <i-button type="primary" icon="ios-search">搜索</i-button>
e1596b7e   梁灏   add Button UI
21
      <br><br>
d6342fe1   jingsam   fixed ie bug
22
      <i-button type="ghost" shape="circle">
e1596b7e   梁灏   add Button UI
23
          <Icon type="search"></Icon>
d6342fe1   jingsam   fixed ie bug
24
25
      </i-button>
      <i-button type="ghost">
e1596b7e   梁灏   add Button UI
26
27
          <Icon type="search"></Icon>
          搜索
d6342fe1   jingsam   fixed ie bug
28
29
      </i-button>
      <i-button type="ghost" shape="circle" size="large">
e1596b7e   梁灏   add Button UI
30
          <Icon type="search"></Icon>
d6342fe1   jingsam   fixed ie bug
31
32
      </i-button>
      <i-button type="ghost" shape="circle" size="small">
e1596b7e   梁灏   add Button UI
33
          <Icon type="search"></Icon>
d6342fe1   jingsam   fixed ie bug
34
      </i-button>
e1596b7e   梁灏   add Button UI
35
      <br><br><br>
d6342fe1   jingsam   fixed ie bug
36
37
38
39
      <i-button type="primary" loading>Loading...</i-button>
      <i-button type="primary" loading size="large">Loading...</i-button>
      <i-button type="primary" loading size="small">Loading...</i-button>
      <i-button type="primary" :loading="loading" @click="toLoading">
e1596b7e   梁灏   add Button UI
40
41
          <span v-if="!loading">Click me!</span>
          <span v-else>Loading...</span>
d6342fe1   jingsam   fixed ie bug
42
43
      </i-button>
      <i-button type="primary" :loading="loading2" icon="checkmark-round" @click="toLoading2">
e1596b7e   梁灏   add Button UI
44
45
          <span v-if="!loading2">Click me!</span>
          <span v-else>Loading...</span>
d6342fe1   jingsam   fixed ie bug
46
      </i-button>
e1596b7e   梁灏   add Button UI
47
48
      <h4>基本</h4>
      <Button-group size="large">
d6342fe1   jingsam   fixed ie bug
49
50
          <i-button>取消</i-button>
          <i-button type="primary">确定</i-button>
e1596b7e   梁灏   add Button UI
51
      </Button-group>
7fa943eb   梁灏   init
52
      <Button-group>
d6342fe1   jingsam   fixed ie bug
53
54
55
          <i-button type="primary">L</i-button>
          <i-button>M</i-button>
          <i-button type="ghost">R</i-button>
e1596b7e   梁灏   add Button UI
56
57
58
      </Button-group>
      <h4>配合图标</h4>
      <Button-group>
d6342fe1   jingsam   fixed ie bug
59
          <i-button type="primary">
e1596b7e   梁灏   add Button UI
60
61
              <Icon type="chevron-left"></Icon>
              前进
d6342fe1   jingsam   fixed ie bug
62
63
          </i-button>
          <i-button type="primary">
e1596b7e   梁灏   add Button UI
64
65
              后退
              <Icon type="chevron-right"></Icon>
d6342fe1   jingsam   fixed ie bug
66
          </i-button>
e1596b7e   梁灏   add Button UI
67
68
      </Button-group>
      <Button-group>
d6342fe1   jingsam   fixed ie bug
69
70
          <i-button type="primary" icon="cloud"></i-button>
          <i-button type="primary" icon="upload"></i-button>
7fa943eb   梁灏   init
71
      </Button-group>
72493927   梁灏   fixed bug: Can no...
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
      <Modal
              :visible="true"
              title="普通的Modal对话框标题">
          <p>对话框内容</p>
          <p>对话框内容</p>
          <p>对话框内容</p>
          <div style="width: 200px">
              <i-select :model.sync="model6" >
                  <i-option value="beijing">北京市</i-option>
                  <i-option value="shanghai" disabled>上海市</i-option>
                  <i-option value="shenzhen">深圳市</i-option>
              </i-select>
          </div>
  
      </Modal>
      <i-select :model.sync="model6" >
          <i-option value="beijing">北京市</i-option>
          <i-option value="shanghai" disabled>上海市</i-option>
          <i-option value="shenzhen">深圳市</i-option>
      </i-select>
7fa943eb   梁灏   init
92
93
  </template>
  <script>
72493927   梁灏   fixed bug: Can no...
94
      import { Button, Icon, Input, Switch, Radio, Checkbox, InputNumber, Row, Col, Page, Modal, iSelect, iOption } from 'iview';
7fa943eb   梁灏   init
95
96
97
98
99
100
      const ButtonGroup = Button.Group;
      const RadioGroup = Radio.Group;
      const CheckboxGroup = Checkbox.Group;
  
      export default {
          components: {
d6342fe1   jingsam   fixed ie bug
101
              iButton: Button,
7fa943eb   梁灏   init
102
103
104
105
106
107
108
109
110
111
112
              ButtonGroup,
              Icon,
              iInput: Input,
              Switch,
              Radio,
              RadioGroup,
              Checkbox,
              CheckboxGroup,
              InputNumber,
              Row,
              iCol: Col,
72493927   梁灏   fixed bug: Can no...
113
114
115
116
              Page,
              Modal,
              iSelect,
              iOption
7fa943eb   梁灏   init
117
118
          },
          props: {
d6342fe1   jingsam   fixed ie bug
119
  
7fa943eb   梁灏   init
120
121
122
          },
          data () {
              return {
e1596b7e   梁灏   add Button UI
123
                  loading: false,
72493927   梁灏   fixed bug: Can no...
124
125
                  loading2: false,
                  model6: ''
d6342fe1   jingsam   fixed ie bug
126
              }
7fa943eb   梁灏   init
127
          },
7fa943eb   梁灏   init
128
          methods: {
e1596b7e   梁灏   add Button UI
129
130
              toLoading () {
                  this.loading = true;
7fa943eb   梁灏   init
131
              },
e1596b7e   梁灏   add Button UI
132
133
              toLoading2 () {
                  this.loading2 = true;
7fa943eb   梁灏   init
134
135
136
137
              }
          }
      }
  </script>