kui-vue 3.4.1 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/components/base/input.jsx +6 -5
  2. package/components/button/demo/group.md +22 -17
  3. package/components/checkbox/demo/base.md +3 -5
  4. package/components/checkbox/demo/group-vertical.md +10 -10
  5. package/components/checkbox/demo/group.md +9 -7
  6. package/components/checkbox/demo/options.md +2 -2
  7. package/components/colorPicker/styles/index.less +8 -0
  8. package/components/datePicker/datepicker.jsx +79 -62
  9. package/components/datePicker/demo/theme.md +1 -1
  10. package/components/descriptions/styles/index.less +41 -6
  11. package/components/drawer/demo/custom.md +2 -2
  12. package/components/drawer/demo/target.md +1 -1
  13. package/components/drawer/styles/index.less +2 -2
  14. package/components/form/demo/base.md +1 -1
  15. package/components/form/demo/info.md +23 -1
  16. package/components/image/demo/errors.md +2 -2
  17. package/components/image/demo/globle.md +2 -2
  18. package/components/image/demo/index.vue +1 -0
  19. package/components/image/image.jsx +3 -1
  20. package/components/image/preview.jsx +12 -2
  21. package/components/image/styles/index.less +25 -0
  22. package/components/input/demo/theme.md +1 -1
  23. package/components/input/styles/index.less +4 -1
  24. package/components/inputNumber/demo/format.md +1 -1
  25. package/components/inputNumber/inputNumber.jsx +2 -1
  26. package/components/inputNumber/styles/index.less +1 -0
  27. package/components/locale/lang/de.js +3 -0
  28. package/components/locale/lang/el.js +3 -0
  29. package/components/locale/lang/en.js +3 -0
  30. package/components/locale/lang/fr.js +3 -0
  31. package/components/locale/lang/it.js +3 -0
  32. package/components/locale/lang/ja.js +3 -0
  33. package/components/locale/lang/ko.js +3 -0
  34. package/components/locale/lang/ru.js +3 -0
  35. package/components/locale/lang/th.js +3 -0
  36. package/components/locale/lang/ua.js +3 -0
  37. package/components/locale/lang/vi.js +3 -0
  38. package/components/locale/lang/zh-CN.js +3 -0
  39. package/components/locale/lang/zh-TW.js +3 -0
  40. package/components/menu/styles/index.less +9 -2
  41. package/components/modal/styles/index.less +3 -0
  42. package/components/page/demo/base.md +10 -1
  43. package/components/page/demo/elevator.md +10 -1
  44. package/components/page/demo/more.md +10 -1
  45. package/components/page/demo/size.md +13 -4
  46. package/components/page/demo/sizer.md +4 -3
  47. package/components/page/page.jsx +13 -0
  48. package/components/radio/demo/base.md +3 -5
  49. package/components/radio/demo/disabled.md +2 -4
  50. package/components/radio/demo/group-vertical.md +8 -11
  51. package/components/radio/demo/group.md +10 -9
  52. package/components/radio/demo/options.md +2 -2
  53. package/components/radio/styles/index.less +1 -1
  54. package/components/select/demo/clearable.md +30 -22
  55. package/components/select/demo/icon.md +6 -4
  56. package/components/select/demo/theme.md +2 -2
  57. package/components/select/select.jsx +1 -1
  58. package/components/select/styles/index.less +10 -84
  59. package/components/switch/demo/base.md +4 -4
  60. package/components/switch/demo/disabled.md +7 -9
  61. package/components/switch/demo/index.vue +1 -6
  62. package/components/switch/demo/text.md +2 -8
  63. package/components/table/demo/base-render.md +3 -3
  64. package/components/table/demo/base.md +3 -1
  65. package/components/table/demo/custom-header.md +5 -1
  66. package/components/table/demo/expand.md +3 -1
  67. package/components/table/demo/selection.md +9 -5
  68. package/components/table/demo/size.md +3 -1
  69. package/components/table/styles/index.less +22 -22
  70. package/components/tree/styles/index.less +2 -1
  71. package/components/upload/demo/accept.md +2 -2
  72. package/components/upload/demo/custom.md +3 -3
  73. package/components/upload/demo/transform.md +3 -1
  74. package/components/upload/upload.jsx +12 -1
  75. package/dist/k-ui.css +2 -2
  76. package/dist/k-ui.js +2 -2
  77. package/dist/locale/de.js +2 -2
  78. package/dist/locale/el.js +2 -2
  79. package/dist/locale/en.js +2 -2
  80. package/dist/locale/fr.js +2 -2
  81. package/dist/locale/it.js +2 -2
  82. package/dist/locale/ja.js +2 -2
  83. package/dist/locale/ko.js +2 -2
  84. package/dist/locale/ru.js +2 -2
  85. package/dist/locale/th.js +2 -2
  86. package/dist/locale/ua.js +2 -2
  87. package/dist/locale/vi.js +2 -2
  88. package/dist/locale/zhCN.js +2 -2
  89. package/dist/locale/zhTW.js +2 -2
  90. package/package.json +1 -1
  91. /package/{readme.md → README.md} +0 -0
@@ -40,6 +40,7 @@ export default {
40
40
  inject: {
41
41
  Input: { default: null },
42
42
  TextArea: { default: null },
43
+ InputNumber: { default: null },
43
44
  },
44
45
  watch: {
45
46
  value(value) {
@@ -47,7 +48,7 @@ export default {
47
48
  }
48
49
  },
49
50
  mounted() {
50
- let textInput = (this.Input || this.TextArea) || {}
51
+ let textInput = (this.Input || this.TextArea || this.InputNumber) || {}
51
52
  textInput.focus = (e) => {
52
53
  this.$nextTick(() => this.$refs.input.focus(e))
53
54
  }
@@ -65,14 +66,14 @@ export default {
65
66
  },
66
67
  handleFocus(e) {
67
68
  this.isFocus = true
68
- let intput = this.Input || this.TextArea
69
+ let intput = this.Input || this.TextArea || this.InputNumber
69
70
  intput && intput.$emit('focus', e)
70
71
  },
71
72
  handleBlur(e) {
72
- let intput = this.Input || this.TextArea
73
+ let intput = this.Input || this.TextArea || this.InputNumber
73
74
  // console.log('base blur')
74
- // this.$emit('blur', e);
75
- intput && intput.$emit('blur', e)
75
+ this.$emit('blur', e);
76
+ // intput && intput.$emit('blur', e)
76
77
  this.isFocus = false
77
78
  },
78
79
  handleInput(e) {
@@ -5,31 +5,36 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <div>
9
- <ButtonGroup size="large">
8
+ <Space>
9
+ <ButtonGroup>
10
10
  <Button>待发货</Button>
11
- <Button>已发货</Button>
12
- <Button>已签收</Button>
11
+ <Dropdown placement="bottom-right">
12
+ <Button :icon="ChevronDown"></Button>
13
+ <Menu slot="content">
14
+ <MenuItem>
15
+ <a href="javascript:;">1st menu item</a>
16
+ </MenuItem>
17
+ <MenuItem>
18
+ <a href="javascript:;">2nd menu item</a>
19
+ </MenuItem>
20
+ <MenuItem>
21
+ <a href="javascript:;">3rd menu item</a>
22
+ </MenuItem>
23
+ </Menu>
24
+ </Dropdown>
13
25
  </ButtonGroup>
14
- <ButtonGroup shape="circle">
15
- <Button>待发货</Button>
16
- <Button>已发货</Button>
17
- <Button>已签收</Button>
18
- </ButtonGroup>
19
- <br />
20
- <br />
21
- <ButtonGroup size="small" shape="circle">
22
- <Button ><Icon :type="ChevronBack"/> Backward</Button>
23
- <Button>Forward <Icon :type="ChevronForward"/></Button>
26
+ <ButtonGroup>
27
+ <Button>通讯录</Button>
28
+ <Button :icon="PersonOutline"></Button>
24
29
  </ButtonGroup>
25
- </div>
30
+ </Space>
26
31
  </template>
27
32
  <script>
28
- import { ChevronBack,ChevronForward } from 'kui-icons'
33
+ import { ChevronDown ,PersonOutline } from 'kui-icons'
29
34
  export default{
30
35
  data() {
31
36
  return {
32
- ChevronBack, ChevronForward
37
+ PersonOutline ,ChevronDown
33
38
  }
34
39
  }
35
40
  }
@@ -5,14 +5,12 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <div>
9
- <p>{{checked}}</p>
8
+ <Space>
9
+ {{checked}}
10
10
  <Checkbox v-model="checked">Checkbox</Checkbox>
11
11
  <Button @click="checked=!checked" size="small">{{checked?'Uncheck':'Check'}}</Button>
12
- <br/>
13
- <br/>
14
12
  <Checkbox label="Checkbox"/>
15
- </div>
13
+ </Space>
16
14
  </template>
17
15
  <script>
18
16
  export default{
@@ -5,13 +5,12 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <div>
9
- <p>{{data}}</p>
10
- <br/>
11
- <Button @click="data=[]" size="small">Clear</Button>
12
- <Button @click="data=['apple']" size="small">Select apple</Button>
13
- <br/>
14
- <br/>
8
+ <Space vertical align="start">
9
+ <Space>
10
+ <Button @click="data=[]" size="small">Clear</Button>
11
+ <Button @click="data=['apple']" size="small">Select apple</Button>
12
+ {{data}}
13
+ </Space>
15
14
  <CheckboxGroup v-model="data" direction="vertical">
16
15
  <Checkbox label="Apple" value="apple" />
17
16
  <Checkbox label="Orange" value="orange" />
@@ -19,11 +18,12 @@
19
18
  <Checkbox label="Grape" value="grape" disabled/>
20
19
  <Checkbox label="Pear" value="pear" disabled/>
21
20
  </CheckboxGroup>
22
- <br/>
21
+ </Space>
22
+ <br/>
23
+ <Space vertical align="start">
23
24
  <p>{{cities}}</p>
24
- <br/>
25
25
  <CheckboxGroup :options="options" v-model="cities" direction="vertical"/>
26
- </div>
26
+ </Space>
27
27
  </template>
28
28
  <script>
29
29
  export default {
@@ -1,13 +1,13 @@
1
1
  <cn>
2
2
  #### 组合使用
3
3
  组合使用可以直接使用 `CheckboxGroup` 的 `options` 来赋值,或者结合 `Checkbox` 来组合使用,通过 `disabled` 可以设置组件是否被禁用
4
- **`CheckboxGroup` 可以直接使用 `options` 来组合,3.0版本增加**
4
+ > `CheckboxGroup` 可以直接使用 `options` 来组合,3.0版本增加
5
5
  </cn>
6
6
 
7
7
  ```vue
8
8
  <template>
9
- <div>
10
- <p>{{data}}</p>
9
+ <Space>
10
+ {{data}}
11
11
  <CheckboxGroup v-model="data">
12
12
  <Checkbox label="Apple" value="apple" />
13
13
  <Checkbox label="Orange" value="orange" />
@@ -17,11 +17,13 @@
17
17
  </CheckboxGroup>
18
18
  <Button @click="data=[]" size="small">Clear</Button>
19
19
  <Button @click="data=['apple']" size="small">Select apple</Button>
20
- <br/>
21
- <br/>
22
- <p>{{cities}}</p>
20
+ </Space>
21
+ <br/>
22
+ <br/>
23
+ <Space vertical align="start">
24
+ {{cities}}
23
25
  <CheckboxGroup :options="options" v-model="cities"/>
24
- </div>
26
+ </Space>
25
27
  </template>
26
28
  <script>
27
29
  export default {
@@ -1,7 +1,7 @@
1
1
  <cn>
2
2
  #### 组合使用Options
3
- - 组合使用可以直接使用 `CheckboxGroup` 的 `options` 来赋值,
4
- - 或者结合子组件 `Checkbox` 来组合使用,通过 `disabled` 可以设置组件是否被禁用
3
+ 组合使用可以直接使用 `CheckboxGroup` 的 `options` 来赋值,
4
+ 或者结合子组件 `Checkbox` 来组合使用,通过 `disabled` 可以设置组件是否被禁用
5
5
  </cn>
6
6
 
7
7
  ```vue
@@ -10,6 +10,7 @@
10
10
  box-sizing: border-box;
11
11
  align-items: center;
12
12
  padding: 0 2px;
13
+
13
14
  &:hover,
14
15
  &:focus {
15
16
  border-color: var(--kui-color-main-hover);
@@ -20,6 +21,7 @@
20
21
  }
21
22
 
22
23
  .k-color-picker-selection {
24
+ line-height: 1.571;
23
25
  display: flex;
24
26
  align-items: center;
25
27
  // padding: 2px;
@@ -266,6 +268,8 @@
266
268
  margin-top: 13px;
267
269
  min-height: 62px;
268
270
  border-top: 1px solid var(--kui-color-border);
271
+ display: flex;
272
+ flex-wrap: wrap;
269
273
 
270
274
  >span {
271
275
  display: inline-block;
@@ -274,6 +278,10 @@
274
278
  border-radius: 2px;
275
279
  margin: 0 6px 6px 0;
276
280
  cursor: pointer;
281
+
282
+ &:hover {
283
+ transform: scale(1.3);
284
+ }
277
285
  }
278
286
 
279
287
  .k-btn {
@@ -5,10 +5,15 @@ import dayjs from 'dayjs'
5
5
  import Drop from '../base/drop'
6
6
  import { t } from '../locale'
7
7
  import { CloseCircle, CalendarOutline, TimeOutline } from 'kui-icons'
8
+ const duration = require('dayjs/plugin/duration');
9
+ const isBetween = require('dayjs/plugin/isBetween');
10
+
11
+ dayjs.extend(duration);
12
+ dayjs.extend(isBetween);
8
13
  export default {
9
14
  name: 'DatePicker',
10
15
  props: {
11
- value: [String, Date, Number, Array],
16
+ value: [String, Date, Number, Array, Object],
12
17
  mode: {
13
18
  type: String, default: 'date', validator(value) {
14
19
  return ["year", "month", "date", 'time', 'dateTime', "dateRange", 'dateTimeRange'].indexOf(value) >= 0;
@@ -99,14 +104,33 @@ export default {
99
104
  let { currentValue, isRange } = this
100
105
  if (isRange) {
101
106
  let [a, b] = currentValue || []
107
+ // if (!this.v1 && a) {
108
+ // this.v1 = dayjs(a)
109
+ // }
110
+ // if (!this.v2 && b) {
111
+ // this.v2 = dayjs(b)
112
+ // }
102
113
  this.d1 = a ? dayjs(a) : dayjs()
103
114
  this.d2 = b ? dayjs(b) : dayjs().add(1, 'month')
104
- if (this.d1.isSame(this.d2, 'month')) {
105
- this.d2 = this.d2.add(1, 'month')
115
+
116
+ const oneMonth = dayjs.duration(1, 'month').asDays();
117
+ const diff = this.d2.diff(this.d1, 'day');
118
+ if (diff < oneMonth) {
119
+ this.d2 = dayjs(this.d1).add(1, 'month')
120
+ }
121
+ if (!this.v1 && a) {
122
+ this.v1 = dayjs(a)
123
+ }
124
+ if (!this.v2 && b) {
125
+ this.v2 = dayjs(b)
106
126
  }
127
+
107
128
  // this.currentValue = [dayjs(this.d1), dayjs(this.d2)]
108
129
  } else {
109
130
  this.d1 = currentValue ? dayjs(currentValue) : dayjs()
131
+ if (!this.v1 && currentValue) {
132
+ this.v1 = dayjs(currentValue)
133
+ }
110
134
  }
111
135
  },
112
136
  clear(e) {
@@ -140,94 +164,87 @@ export default {
140
164
  }
141
165
  },
142
166
  picker1Update(value, type) {
143
- let { isRange, format, fmt, mode } = this
144
- if (!isRange) {
145
- if (!type) { //for day
146
- this.d1 = dayjs(value)
147
- this.v1 = dayjs(value)
148
- } else {
149
- this.d1 = this.d1[type](value)
150
- this.v1 = (this.v1 || dayjs())[type](value)
151
-
152
- if (type == 'second' && mode == 'time') {
153
- this.opened = false
154
- }
155
- }
156
- let ft = format || fmt[mode]
157
- let dateStr = this.v1.format(ft)
158
- this.currentValue = dayjs(this.v1)
159
- this.$emit('input', dateStr)
160
- this.$emit('change', this.currentValue, dateStr)
161
-
162
- } else {
163
- let { v1, v2, withTime } = this
164
- if (!type) { //for day
165
- this.d1 = dayjs(value)
166
- if (!v1 && !v2) {
167
- this.v1 = dayjs(value)
167
+ let { v1, v2, withTime, format, fmt, mode, isRange } = this
168
+ if (isRange) {
169
+ if (!type) { //day
170
+ let result = dayjs(value)
171
+ if (!v1) {
172
+ this.v1 = result
168
173
  this.currentValue = [dayjs(value), v2]
169
174
  } else if (v1 && !v2) {
170
- this.v2 = dayjs(value)
175
+ this.v2 = result
171
176
  this.currentValue = [v1, this.v2]
172
-
173
- this.updateStr()
174
-
175
177
  if (!withTime) {
176
178
  this.opened = false
177
179
  }
178
180
  } else if (v1 && v2) {
179
- this.v1 = dayjs(value)
181
+ this.v1 = result
180
182
  this.v2 = null
181
- this.currentValue = [dayjs(value), v2]
183
+ this.currentValue = [dayjs(value), null]
182
184
  }
183
- } else {
184
- this.v1 = (this.v1 || dayjs(this.d1))[type](value)
185
- this.currentValue = [this.v1, v2]
186
- this.d1 = this.d1[type](value)
185
+ this.updateStr()
187
186
 
187
+ } else {
188
+ let _v1 = (v1 || dayjs(this.d1))[type](value)
189
+ this.v1 = _v1
190
+ if (v2) {
191
+ const oneMonth = dayjs.duration(1, 'month').asDays();
192
+ const diff = _v1.diff(v2, 'day');
193
+ // console.log(oneMonth, diff)
194
+ if (diff > oneMonth) {
195
+ v2 = dayjs(_v1).add(1, 'month')
196
+ }
197
+ this.v2 = v2
198
+ }
199
+ this.currentValue = [_v1, v2]
188
200
  this.updateStr()
189
201
  }
190
- if (this.d1.isSame(this.d2, 'month') || this.d1.isAfter(this.d2, 'month')) {
191
- this.d2 = this.d2.add(1, 'month')
192
- }
202
+ } else {
203
+ let result = !type ? dayjs(value) : (this.v1 || dayjs())[type](value)
204
+ this.v1 = dayjs(result)
205
+ this.currentValue = dayjs(result)
206
+ this.updateStr()
193
207
  }
194
208
  },
195
-
196
209
  picker2Update(value, type) {
197
210
  let { v1, v2, withTime, format, fmt, mode } = this
198
- if (!type) { //for day
199
- this.d2 = dayjs(value)
211
+ if (!type) { //day
212
+ let result = dayjs(value)
200
213
  if (!v1) {
201
- this.v1 = dayjs(value)
214
+ this.v1 = result
202
215
  this.currentValue = [dayjs(value), v2]
203
216
  } else if (v1 && !v2) {
204
- this.v2 = dayjs(value)
217
+ this.v2 = result
205
218
  this.currentValue = [v1, this.v2]
206
-
207
- this.updateStr()
208
219
  if (!withTime) {
209
220
  this.opened = false
210
221
  }
211
222
  } else if (v1 && v2) {
212
- this.v1 = dayjs(value)
223
+ this.v1 = result
213
224
  this.v2 = null
214
- this.currentValue = [dayjs(value), this.v2]
225
+ this.currentValue = [dayjs(value), null]
215
226
  }
216
- } else { //for year , month , datetime
217
-
218
- this.v2 = (this.v2 || dayjs(this.d2))[type](value)
219
- this.d2 = this.d2[type](value)
220
- this.currentValue = [v1, this.v2]
221
227
  this.updateStr()
222
- }
223
- if (this.d2.isSame(this.d1, 'month') || this.d2.isBefore(this.d1, 'month')) {
224
- this.d1 = this.d1.subtract(1, 'month')
228
+ } else {
229
+ let _v2 = (v2 || dayjs(this.d2))[type](value)
230
+ this.v2 = _v2
231
+ if (v1) {
232
+ const oneMonth = dayjs.duration(1, 'month').asDays();
233
+ const diff = _v2.diff(v1, 'day');
234
+ // console.log(oneMonth, diff)
235
+ if (diff < 0) {
236
+ v1 = dayjs(_v2).subtract(1, 'month')
237
+ }
238
+ this.v1 = v1
239
+ }
240
+ this.currentValue = [v1, _v2]
241
+ this.updateStr()
225
242
  }
226
243
  },
227
244
  updateStr() {
228
- let { v1, v2, withTime, format, fmt, mode } = this
245
+ let { v1, v2, isRange, format, fmt, mode } = this
229
246
  let ft = format || fmt[mode]
230
- let dateStr = [v1 ? v1.format(ft) : null, v2 ? v2.format(ft) : null]
247
+ let dateStr = isRange ? [v1 ? v1.format(ft) : null, v2 ? v2.format(ft) : null] : v1.format(ft)
231
248
  this.$emit('input', dateStr)
232
249
  this.$emit('change', this.currentValue, dateStr)
233
250
  this.updateCalendDate()
@@ -236,7 +253,7 @@ export default {
236
253
  // 只有一个值的时候, 直接置空
237
254
  if (this.isRange) {
238
255
  let [a, b] = this.currentValue || []
239
- if (a && !b) {
256
+ if ((a && !b) || (!a && b)) {
240
257
  this.clear(e)
241
258
  }
242
259
  }
@@ -403,7 +420,7 @@ export default {
403
420
  }
404
421
  let overlay = <Drop {...props}>{calendar}</Drop >
405
422
 
406
- let showClear = !disabled && clearable && ((isRange && this.v1 && this.v2) || (!isRange && this.v1))
423
+ let showClear = !disabled && clearable && ((isRange && v1 && v2) || (!isRange && v1))
407
424
  showClear && childNode.push(<Icon class="k-datepicker-clearable" type={CloseCircle} onClick={this.clear} />)
408
425
  const selectCls = [
409
426
  "k-datepicker-selection", {
@@ -6,7 +6,7 @@ theme=light 呈现浅色主题, shape=circle 呈现圆角, dateIcon 可自定义
6
6
  ```vue
7
7
  <template>
8
8
  <div>
9
- <Checkbox v-model="shape" label="Shape" />
9
+ <Checkbox v-model="shape" label="Circle" />
10
10
  <br/>
11
11
  <br/>
12
12
  <DatePicker theme="light" :shape="shape?'circle':''"/>
@@ -4,6 +4,7 @@
4
4
  align-items: center;
5
5
  margin-bottom: 20px;
6
6
  }
7
+
7
8
  .k-descriptions-title {
8
9
  flex: auto;
9
10
  overflow: hidden;
@@ -14,27 +15,35 @@
14
15
  white-space: nowrap;
15
16
  text-overflow: ellipsis;
16
17
  }
18
+
17
19
  .k-descriptions-view {
18
20
  width: 100%;
19
21
  border-radius: 2px;
22
+
20
23
  table {
21
24
  width: 100%;
22
25
  border-collapse: collapse;
23
26
  border-spacing: 0;
24
27
  table-layout: auto;
28
+ margin: 0;
25
29
  }
26
30
  }
27
- .k-descriptions-row{
31
+
32
+ .k-descriptions-row {
28
33
  border: none;
29
34
  background: none;
30
35
  }
36
+
31
37
  .k-descriptions-row>.k-descripts-item {
32
38
  padding-bottom: 16px;
33
- .k-descriptions-item-label, .k-descriptions-item-content {
39
+
40
+ .k-descriptions-item-label,
41
+ .k-descriptions-item-content {
34
42
  display: inline-flex;
35
43
  font-size: 14px;
36
44
  line-height: 1.5;
37
45
  }
46
+
38
47
  .k-descriptions-item-label {
39
48
  &::after {
40
49
  content: ":";
@@ -47,12 +56,32 @@
47
56
  }
48
57
 
49
58
  .k-descriptions-bordered {
50
- .k-descriptions-item-label, .k-descriptions-item-content {
51
- padding: 16px 24px;
59
+
60
+ .k-descriptions-view {
52
61
  border: 1px solid var(--kui-color-gray-80);
62
+ border-radius: @radius;
63
+ }
64
+
65
+ .k-descriptions-row {
66
+ border-bottom: 1px solid var(--kui-color-gray-80);
67
+
68
+ &:last-child {
69
+ border-bottom: none;
70
+ }
71
+ }
72
+
73
+ .k-descriptions-item-label,
74
+ .k-descriptions-item-content {
75
+ padding: 16px 24px;
53
76
  font-size: 14px;
54
77
  line-height: 1.5;
78
+ border-left: 1px solid var(--kui-color-gray-80);
79
+
80
+ &:first-child {
81
+ border: none;
82
+ }
55
83
  }
84
+
56
85
  .k-descriptions-item-label {
57
86
  background: var(--kui-color-gray-90);
58
87
  font-weight: 400;
@@ -74,8 +103,11 @@
74
103
  .k-descriptions-row>.k-descripts-item {
75
104
  padding-bottom: 12px;
76
105
  }
106
+
77
107
  &.k-descriptions-bordered {
78
- .k-descriptions-item-label, .k-descriptions-item-content {
108
+
109
+ .k-descriptions-item-label,
110
+ .k-descriptions-item-content {
79
111
  padding: 12px 24px;
80
112
  }
81
113
  }
@@ -85,8 +117,11 @@
85
117
  .k-descriptions-row>.k-descripts-item {
86
118
  padding-bottom: 8px;
87
119
  }
120
+
88
121
  &.k-descriptions-bordered {
89
- .k-descriptions-item-label, .k-descriptions-item-content {
122
+
123
+ .k-descriptions-item-label,
124
+ .k-descriptions-item-content {
90
125
  padding: 8px 16px;
91
126
  }
92
127
  }
@@ -5,7 +5,7 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <div style="overflow:hidden">
8
+ <Space>
9
9
  <RadioGroup v-model="placement">
10
10
  <Radio label="left" value="left"/>
11
11
  <Radio label="top" value="top"/>
@@ -14,7 +14,7 @@
14
14
  </RadioGroup>
15
15
  <Button @click="show=true" >Open</Button>
16
16
  <Drawer v-model="show" height="300" :placement="placement" title="What's your name? " cancelText="Cancel" okText="Ok">My name is chuchur.</Drawer>
17
- </div>
17
+ </Space>
18
18
  </template>
19
19
  <script>
20
20
  export default{
@@ -7,7 +7,6 @@
7
7
  ```vue
8
8
  <template>
9
9
  <div ref="drawer-box" style="height:300px;position:relative;overflow:hidden">
10
- <Button @click="show=!show">普通抽屉</Button>
11
10
  <RadioGroup v-model="placement">
12
11
  <Radio label="left" value="left"/>
13
12
  <Radio label="top" value="top"/>
@@ -22,6 +21,7 @@
22
21
  <p>something ...</p>
23
22
  <p>something ...</p>
24
23
  </Drawer>
24
+ <Button @click="show=!show">Open</Button>
25
25
  </div>
26
26
  </template>
27
27
  <script>
@@ -56,7 +56,7 @@
56
56
  }
57
57
  }
58
58
  .k-drawer-header {
59
- border-bottom: 1px solid var(--kui-color-border);
59
+ // border-bottom: 1px solid var(--kui-color-border);
60
60
  padding: 14px 35px 14px 16px;
61
61
  line-height: 1;
62
62
  font-size: 14px;
@@ -84,7 +84,7 @@
84
84
  color: var(--kui-color-font);
85
85
  }
86
86
  .k-drawer-footer {
87
- border-top: 1px solid var(--kui-color-border);
87
+ // border-top: 1px solid var(--kui-color-border);
88
88
  padding: 10px 16px;
89
89
  text-align: right;
90
90
  display: inline-block;
@@ -9,7 +9,7 @@
9
9
  <Form :labelCol="{span:5}" :wrapperCol="{span:16}" :size="size" :theme="theme?'light':''" :shape="checked?'circle':''">
10
10
  <FormItem label="主题">
11
11
  <Checkbox v-model="theme" label="Light" style="margin-right:8px;"/>
12
- <Checkbox v-model="checked" label="Shape"/>
12
+ <Checkbox v-model="checked" label="Circle"/>
13
13
  </FormItem>
14
14
  <FormItem label="尺寸">
15
15
  <RadioGroup v-model="size" type="button">
@@ -5,4 +5,26 @@
5
5
  - 用于创建一个实体或收集信息。
6
6
  - 需要对输入的数据类型进行校验时。
7
7
 
8
- ## 代码演示
8
+ ## 代码演示
9
+
10
+ 在 `Modal` `Drawer` 中 , 如果要在打开Modal 或者 Drawer 的时候对表单 进行重置, 请使用异步 :
11
+
12
+ ```javascript
13
+ // 组件在open 的之前 也就是没有完全渲染完毕, 这个时候 读取 dom 对象是 undefined,
14
+ // 子组件没有渲染完毕 this.$refs.form 为 undefined, 所以无法重置
15
+ // 使用异步方式
16
+ // 当然也在 Modal 或者 Drawer @close 的时候 重置表单
17
+ export default{
18
+ methods :{
19
+ reset(){
20
+ this.$nextTick(()=>{
21
+ this.$refs.form.reset()
22
+ })
23
+ // 或者
24
+ setTimeout(() => {
25
+ this.$refs.form.reset()
26
+ }, 0);
27
+ }
28
+ }
29
+ }
30
+ ```
@@ -6,7 +6,7 @@
6
6
 
7
7
  ```vue
8
8
  <template>
9
- <div>
9
+ <Space>
10
10
  <Image
11
11
  :width="120"
12
12
  src="https://k-ui.cn/error.jpg"
@@ -23,7 +23,7 @@
23
23
  :src="src"
24
24
  />
25
25
  <Button @click="loadOrigin">Load origin</Button>
26
- </div>
26
+ </Space>
27
27
  </template>
28
28
  <script>
29
29
  export default{