Commit 8a83e7c42b961eced21421bb95c1351b9a03e6fe

Authored by 梁灏
1 parent f706ef31

update Form

update Form
src/components/form/form-item.vue
... ... @@ -57,7 +57,7 @@
57 57 type: [Object, Array]
58 58 },
59 59 error: {
60   - type: Boolean
  60 + type: String
61 61 },
62 62 validateStatus: {
63 63 type: Boolean
... ...
src/styles/components/input.less
... ... @@ -6,6 +6,7 @@
6 6 display: inline-block;
7 7 width: 100%;
8 8 position: relative;
  9 + vertical-align: middle;
9 10 }
10 11 &-icon {
11 12 width: 32px;
... ...
src/styles/mixins/input.less
... ... @@ -102,6 +102,7 @@
102 102 border-collapse: separate;
103 103 position: relative;
104 104 font-size: @font-size-small;
  105 + top: 1px; // fixed when using in form inline,
105 106  
106 107 &-large{
107 108 font-size: @font-size-base;
... ...
test/routers/button.vue
1 1 <template>
2 2 <h4>基本</h4>
3 3 <br><br>
  4 + <div style="background: #f60">
  5 + <input-number></input-number>
  6 + <Date-picker type="date" placeholder="选择日期" style="width: 100px;display: inline-block"></Date-picker>
  7 + <i-input style="width: 100px"></i-input>
  8 + <i-input type="text" placeholder="Username" style="width: 100px">
  9 + <Icon type="ios-person-outline" slot="prepend"></Icon>
  10 + </i-input>
  11 + <i-button type="primary">按钮</i-button>
  12 + <i-select :model.sync="model1" style="width:200px">
  13 + <i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option>
  14 + </i-select>
  15 + </div>
  16 + <br><br>
4 17 <i-button type="success">按钮</i-button>
5 18 <i-button type="warning">按钮</i-button>
6 19 <i-button type="error">按钮</i-button>
... ... @@ -244,27 +257,7 @@
244 257 </Button-group>
245 258 </template>
246 259 <script>
247   - import { iButton, Icon, Input, Switch, Radio, Checkbox, InputNumber, Row, Col, Page } from 'iview';
248   - const ButtonGroup = iButton.Group;
249   - const RadioGroup = Radio.Group;
250   - const CheckboxGroup = Checkbox.Group;
251   -
252 260 export default {
253   - components: {
254   - iButton,
255   - ButtonGroup,
256   - Icon,
257   - iInput: Input,
258   - Switch,
259   - Radio,
260   - RadioGroup,
261   - Checkbox,
262   - CheckboxGroup,
263   - InputNumber,
264   - Row,
265   - iCol: Col,
266   - Page
267   - },
268 261 props: {
269 262  
270 263 },
... ... @@ -272,7 +265,34 @@
272 265 return {
273 266 loading: false,
274 267 loading2: false,
275   - model6: ''
  268 + model6: '',
  269 + cityList: [
  270 + {
  271 + value: 'beijing',
  272 + label: '北京市'
  273 + },
  274 + {
  275 + value: 'shanghai',
  276 + label: '上海市'
  277 + },
  278 + {
  279 + value: 'shenzhen',
  280 + label: '深圳市'
  281 + },
  282 + {
  283 + value: 'hangzhou',
  284 + label: '杭州市'
  285 + },
  286 + {
  287 + value: 'nanjing',
  288 + label: '南京市'
  289 + },
  290 + {
  291 + value: 'chongqing',
  292 + label: '重庆市'
  293 + }
  294 + ],
  295 + model1: ''
276 296 }
277 297 },
278 298 methods: {
... ...