kui-vue 3.2.2 → 3.2.4

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 (111) hide show
  1. package/components/affix/affix.jsx +23 -75
  2. package/components/affix/demo/container.md +14 -7
  3. package/components/affix/index.md +7 -5
  4. package/components/alert/styles/index.less +13 -8
  5. package/components/avatar/avatar.jsx +63 -0
  6. package/components/avatar/demo/base.md +24 -0
  7. package/components/avatar/demo/change.md +40 -0
  8. package/components/avatar/demo/index.vue +20 -0
  9. package/components/avatar/demo/info.md +7 -0
  10. package/components/avatar/demo/types.md +23 -0
  11. package/components/avatar/index.js +2 -0
  12. package/components/avatar/index.md +7 -0
  13. package/components/avatar/styles/index.less +61 -0
  14. package/components/badge/styles/index.less +1 -2
  15. package/components/base/pop.jsx +1 -1
  16. package/components/breadcrumb/styles/index.less +2 -2
  17. package/components/button/demo/hollow.md +1 -1
  18. package/components/button/styles/index.less +5 -5
  19. package/components/card/demo/border.md +1 -1
  20. package/components/card/styles/index.less +4 -3
  21. package/components/checkbox/checkbox.jsx +4 -2
  22. package/components/checkbox/styles/index.less +49 -44
  23. package/components/collapse/styles/index.less +3 -10
  24. package/components/colorPicker/styles/index.less +5 -3
  25. package/components/datePicker/styles/calendar.less +6 -5
  26. package/components/datePicker/styles/datepicker.less +3 -3
  27. package/components/divider/styles/index.less +7 -6
  28. package/components/drawer/drawer.jsx +10 -8
  29. package/components/drawer/styles/index.less +2 -1
  30. package/components/dropdown/demo/rightmenu.md +2 -3
  31. package/components/dropdown/styles/index.less +2 -2
  32. package/components/empty/styles/index.less +1 -1
  33. package/components/form/styles/index.less +1 -0
  34. package/components/grid/demo/align.md +3 -3
  35. package/components/grid/demo/fill.md +3 -3
  36. package/components/grid/demo/flex.md +5 -5
  37. package/components/grid/demo/index.vue +0 -1
  38. package/components/icon/demo/search.vue +2 -2
  39. package/components/image/instance.js +1 -1
  40. package/components/image/preview.jsx +50 -20
  41. package/components/image/styles/index.less +7 -5
  42. package/components/index.js +7 -1
  43. package/components/input/styles/index.less +2 -1
  44. package/components/layout/demo/base.md +3 -4
  45. package/components/layout/demo/layout1.md +4 -4
  46. package/components/layout/demo/layout2.md +5 -6
  47. package/components/layout/demo/layout3.md +3 -4
  48. package/components/layout/demo/layout4.md +4 -4
  49. package/components/layout/demo/layout5.md +8 -8
  50. package/components/layout/demo/layout6.md +2 -2
  51. package/components/layout/styles/index.less +2 -3
  52. package/components/loading/styles/index.less +1 -1
  53. package/components/menu/styles/dropmenu.less +7 -6
  54. package/components/menu/styles/index.less +13 -9
  55. package/components/message/styles/index.less +1 -1
  56. package/components/modal/modal.jsx +10 -8
  57. package/components/modal/styles/index.less +7 -6
  58. package/components/notice/styles/index.less +1 -1
  59. package/components/page/styles/index.less +1 -1
  60. package/components/popconfirm/styles/index.less +3 -2
  61. package/components/poptip/styles/index.less +4 -3
  62. package/components/progress/styles/index.less +3 -3
  63. package/components/radio/radio.jsx +3 -5
  64. package/components/radio/styles/index.less +60 -55
  65. package/components/rate/index.md +3 -3
  66. package/components/rate/styles/index.less +1 -1
  67. package/components/select/styles/index.less +8 -7
  68. package/components/slider/demo/base.md +35 -0
  69. package/components/slider/demo/index.vue +18 -0
  70. package/components/slider/demo/info.md +7 -0
  71. package/components/slider/demo/vertical.md +13 -0
  72. package/components/slider/index.md +7 -0
  73. package/components/slider/slider.jsx +58 -0
  74. package/components/slider/styles/index.less +60 -32
  75. package/components/space/demo/align.md +46 -0
  76. package/components/space/demo/base.md +20 -0
  77. package/components/space/demo/custom-size.md +35 -0
  78. package/components/space/demo/index.vue +25 -0
  79. package/components/space/demo/info.md +11 -0
  80. package/components/space/demo/size.md +35 -0
  81. package/components/space/demo/vertical.md +19 -0
  82. package/components/space/index.js +2 -0
  83. package/components/space/index.md +6 -0
  84. package/components/space/space.jsx +57 -0
  85. package/components/space/styles/index.less +23 -0
  86. package/components/spin/demo/container.md +1 -2
  87. package/components/spin/demo/mode.md +1 -2
  88. package/components/spin/styles/index.less +1 -1
  89. package/components/styles/dark.less +70 -0
  90. package/components/styles/global-dark.less +36 -0
  91. package/components/styles/global.less +22 -12
  92. package/components/styles/index.less +8 -10
  93. package/components/switch/styles/index.less +4 -3
  94. package/components/table/demo/base-render.md +1 -1
  95. package/components/table/demo/base.md +5 -2
  96. package/components/table/styles/index.less +11 -7
  97. package/components/table/table.jsx +10 -7
  98. package/components/tabs/demo/sample.md +1 -1
  99. package/components/tabs/styles/index.less +7 -10
  100. package/components/tag/styles/index.less +40 -39
  101. package/components/timeline/styles/index.less +3 -2
  102. package/components/tooltip/styles/index.less +22 -3
  103. package/components/tree/styles/index.less +8 -8
  104. package/dist/k-ui-dark.css +1 -0
  105. package/dist/k-ui.css +1 -7
  106. package/dist/k-ui.js +2 -2
  107. package/package.json +11 -9
  108. package/components/slider/demo/slider.js +0 -5
  109. package/components/slider/slider.vue +0 -21
  110. package/components/slider/sliderButton.vue +0 -76
  111. package/components/styles.js +0 -43
@@ -7,13 +7,14 @@
7
7
  .k-poptip-content {
8
8
  min-width: 200px;
9
9
  // max-width: 300px;
10
+ color: @color;
10
11
  font-size: 12px;
11
12
  line-height: 1.5;
12
13
  position: absolute;
13
14
  z-index: 1001;
14
15
  transform: translateZ(0);
15
16
  .k-poptip-inner {
16
- background: #fff;
17
+ background: @back-color;
17
18
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
18
19
  border-radius: @radius;
19
20
  }
@@ -28,7 +29,7 @@
28
29
  margin: 0;
29
30
  padding: 8px 16px;
30
31
  position: relative;
31
- border-bottom: 1px solid #eee;
32
+ border-bottom: 1px solid darken(@back-color,5%);
32
33
  text-overflow: ellipsis;
33
34
  overflow: hidden;
34
35
  }
@@ -41,7 +42,7 @@
41
42
  align-items: center;
42
43
  width: 19px;
43
44
  .k-poptip-arrow-content {
44
- background-color: #fff;
45
+ background-color: @back-color;
45
46
  transform: rotate(45deg);
46
47
  width: 12px;
47
48
  height: 12px;
@@ -3,8 +3,8 @@
3
3
  .k-progress-inner {
4
4
  display: inline-block;
5
5
  border-radius: 10px;
6
- background-color: @disable-back;
7
- stroke: @disable-back;
6
+ background-color: fadeout(@border-color, 50%);
7
+ stroke: fadeout(@border-color, 50%);
8
8
  overflow: hidden;
9
9
  vertical-align: middle;
10
10
  width: calc(100% - 38px);
@@ -96,7 +96,7 @@
96
96
  top: 0;
97
97
  width: 0;
98
98
  height: 100%;
99
- background-color: #fff;
99
+ background-color: @back-color;
100
100
  opacity: 0;
101
101
  border-radius: 10px;
102
102
  animation: k-progress-active 2.4s linear infinite;
@@ -53,15 +53,13 @@ export default {
53
53
  }
54
54
  }
55
55
  const wpclasses = [
56
- "k-radio-wrapper", { ["k-radio-disabled"]: disabled }
57
- ];
58
- const classes = [
59
- "k-radio", { ["k-radio-checked"]: checked }
56
+ "k-radio-wrapper", { ["k-radio-disabled"]: disabled, ["k-radio-checked"]: checked }
60
57
  ];
58
+
61
59
  const labelNode = label || $slots.default
62
60
  return (
63
61
  <label class={wpclasses} onClick={e => e.stopPropagation()}>
64
- <span class={classes}>
62
+ <span class="k-radio">
65
63
  <input type="radio" class="k-radio-input" disabled={disabled} checked={checked} onChange={change} />
66
64
  <span class="k-radio-inner"></span>
67
65
  </span>
@@ -1,7 +1,7 @@
1
1
  @import '../../styles/global.less';
2
2
  .k-radio-group {
3
3
  display: inline-block;
4
- font-size: 0;
4
+ // font-size: 0;
5
5
  // vertical-align: middle;
6
6
  white-space: nowrap;
7
7
  .k-btn {
@@ -30,6 +30,9 @@
30
30
  color: @main;
31
31
  border-color: @main;
32
32
  }
33
+ .k-radio-wrapper {
34
+ margin-right: 16px;
35
+ }
33
36
  }
34
37
 
35
38
  .k-radio-cirle {
@@ -49,6 +52,7 @@
49
52
  font-size: 12px;
50
53
  display: inline-block;
51
54
  line-height: 1;
55
+ color: @color;
52
56
  .k-radio {
53
57
  display: inline-block;
54
58
  vertical-align: middle;
@@ -59,73 +63,74 @@
59
63
  position: relative;
60
64
  margin: 0;
61
65
  font-size: 0;
62
- .k-radio-inner {
66
+ }
67
+ .k-radio-inner {
68
+ box-sizing: content-box;
69
+ display: inline-block;
70
+ width: 14px;
71
+ height: 14px;
72
+ position: relative;
73
+ top: 0;
74
+ left: 0;
75
+ border: 1px solid @border-color;
76
+ border-radius: 2px;
77
+ background-color: @back-color;
78
+ transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
79
+ border-radius: 50%;
80
+ &:after {
63
81
  box-sizing: content-box;
64
- display: inline-block;
65
- width: 14px;
66
- height: 14px;
67
- position: relative;
68
- top: 0;
69
- left: 0;
70
- border: 1px solid @border-color;
71
- border-radius: 2px;
72
- background-color: #fff;
73
- transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
74
- border-radius: 50%;
75
- &:after {
76
- box-sizing: content-box;
77
- width: 4px;
78
- height: 4px;
79
- position: absolute;
80
- left: 5px;
81
- top: 5px;
82
- border-radius: 6px;
83
- display: block;
84
- content: " ";
85
- opacity: 0;
86
- background-color: @main;
87
- transition: all .2s ease-in-out;
88
- }
89
- }
90
- .k-radio-input {
91
- width: 100%;
92
- height: 100%;
82
+ width: 4px;
83
+ height: 4px;
93
84
  position: absolute;
94
- top: 0;
95
- bottom: 0;
96
- left: 0;
97
- right: 0;
98
- z-index: 1;
99
- cursor: pointer;
85
+ left: 5px;
86
+ top: 5px;
87
+ border-radius: 6px;
88
+ display: block;
89
+ content: " ";
100
90
  opacity: 0;
101
- &:focus {
102
- +.k-radio-inner {
103
- border: 1px solid @main;
104
- box-shadow: 0 0 5px fade(@main, 75%);
105
- }
106
- }
91
+ background-color: @main;
92
+ transition: all .2s ease-in-out;
107
93
  }
108
94
  }
109
- .k-radio-checked {
110
- .k-radio-inner {
111
- background: #fff;
112
- border-color: @main;
113
- position: relative;
114
- &:after {
115
- opacity: 1;
116
- width: 8px;
117
- height: 8px;
118
- left: 3px;
119
- top: 3px;
95
+ .k-radio-input {
96
+ width: 100%;
97
+ height: 100%;
98
+ position: absolute;
99
+ top: 0;
100
+ bottom: 0;
101
+ left: 0;
102
+ right: 0;
103
+ z-index: 1;
104
+ cursor: pointer;
105
+ opacity: 0;
106
+ &:focus {
107
+ +.k-radio-inner {
108
+ border: 1px solid @main;
109
+ box-shadow: 0 0 5px fade(@main, 75%);
120
110
  }
121
111
  }
122
112
  }
123
113
  .k-radio-label {
124
- padding: 0 8px;
114
+ padding-left: 8px;
125
115
  vertical-align: middle;
126
116
  }
127
117
  }
128
118
 
119
+ .k-radio-checked {
120
+ .k-radio-inner {
121
+ background: @back-color;
122
+ border-color: @main;
123
+ position: relative;
124
+ &:after {
125
+ opacity: 1;
126
+ width: 8px;
127
+ height: 8px;
128
+ left: 3px;
129
+ top: 3px;
130
+ }
131
+ }
132
+ }
133
+
129
134
  .k-radio-disabled {
130
135
  cursor: not-allowed;
131
136
  // opacity: .5;
@@ -1,12 +1,12 @@
1
1
  ### Rate API
2
2
  | 属性 | 说明 | 类型 | 默认值 |
3
- |----------------|------------------------|-------------------------|--------|
3
+ | -------------- | ---------------------- | ----------------------- | ------ |
4
4
  | value(v-model) | 当前数,受控值 | Number | - |
5
5
  | allowClear | 是否允许再次点击后清除 | Boolean | false |
6
6
  | allowHalf | 是否允许半选 | Boolean | - |
7
7
  | showScore | 是否显示分数 | Boolean | - |
8
8
  | character | 自定义字符 | String | - |
9
- | count | star 总数 | String | - |
9
+ | count | star 总数 | Number | - |
10
10
  | disabled | 只读,无法进行交互 | String | - |
11
11
  | tooltips | 自定义每项的提示信息 | String[] | - |
12
- | chnage | 选择时的回调 | Function(value:number)) | - |
12
+ | change | 选择时的回调 | Function(value:number)) | - |
@@ -19,7 +19,7 @@
19
19
  opacity: 0;
20
20
  }
21
21
  .k-star-back {
22
- color: #ddd;
22
+ color: @border-color;
23
23
  }
24
24
  }
25
25
  .k-star-checked {
@@ -6,7 +6,7 @@
6
6
  min-width: 80px;
7
7
  box-sizing: border-box;
8
8
  vertical-align: middle;
9
- color: #495060;
9
+ color: @color;
10
10
  font-size: 12px;
11
11
  position: relative;
12
12
  outline: none;
@@ -27,7 +27,6 @@
27
27
  user-select: none;
28
28
  cursor: pointer;
29
29
  position: relative;
30
- background-color: #fff;
31
30
  border: 1px solid @border-color;
32
31
  min-height: 32px;
33
32
  position: relative;
@@ -50,6 +49,7 @@
50
49
  background: none;
51
50
  outline: none;
52
51
  font-size: 12px;
52
+ color: @color;
53
53
  }
54
54
  }
55
55
  &-labels {
@@ -183,7 +183,7 @@
183
183
  width: inherit;
184
184
  max-height: 200px;
185
185
  overflow: auto;
186
- background-color: #fff;
186
+ background-color: @back-color;
187
187
  box-sizing: border-box;
188
188
  box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
189
189
  position: absolute;
@@ -209,7 +209,7 @@
209
209
  line-height: normal;
210
210
  padding: 7px 16px;
211
211
  clear: both;
212
- color: #495060;
212
+ color: @color;
213
213
  font-size: 12px !important;
214
214
  white-space: nowrap;
215
215
  list-style: none;
@@ -220,7 +220,7 @@
220
220
  cursor: pointer;
221
221
  position: relative;
222
222
  &:hover {
223
- background: @light;
223
+ background: @hover-color;
224
224
  }
225
225
  .k-icon {
226
226
  position: absolute;
@@ -237,11 +237,11 @@
237
237
  }
238
238
  }
239
239
  .k-select-item-selected {
240
- background: tint(@main, 90%);
240
+ background: @selected-color;
241
241
  color: @main;
242
242
  font-weight: 500;
243
243
  &:hover {
244
- background: tint(@main, 90%);
244
+ background: @selected-color;
245
245
  }
246
246
  .k-icon {
247
247
  color: @main;
@@ -351,6 +351,7 @@
351
351
  }
352
352
  .k-select-search-mirror, .k-select-search {
353
353
  font-size: 14px;
354
+ color: @color;
354
355
  }
355
356
  }
356
357
  .k-select-labels {
@@ -0,0 +1,35 @@
1
+ <cn>
2
+ #### 基本用法
3
+ 基本用法
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <div>
9
+ <Slider value="30"/>
10
+ <Slider value="30" disabled/>
11
+ <br/>
12
+ <br/>
13
+ <Space>
14
+ <Slider min="1" v-model="v" max="10"/>
15
+ <Input v-model="v" size="small" style="width:60px">
16
+ </Space>
17
+ <br/>
18
+ <br/>
19
+ <Space>
20
+ <Slider min="1" v-model="v2" max="10" :step="0.1"/>
21
+ <Input v-model="v2" size="small" style="width:60px">
22
+ </Space>
23
+ </div>
24
+ </template>
25
+ <script>
26
+ export default{
27
+ data(){
28
+ return{
29
+ v:3,
30
+ v2:3.5
31
+ }
32
+ }
33
+ }
34
+ </script>
35
+ ```
@@ -0,0 +1,18 @@
1
+ <script>
2
+ import Info from "./info";
3
+ import Base from "./base";
4
+ // import Vertical from "./vertical";
5
+
6
+ import CN from "../index.md";
7
+ export default {
8
+ render() {
9
+ return (
10
+ <div class="switch-demo">
11
+ <Info class="typo" />
12
+ <Base />
13
+ <CN class="typo" />
14
+ </div>
15
+ );
16
+ },
17
+ };
18
+ </script>
@@ -0,0 +1,7 @@
1
+ # Slider 滑动输入条
2
+ 滑动型输入器,展示当前值和可选范围。
3
+
4
+ ## 何时使用
5
+
6
+ 当用户需要在数值区间/自定义区间内进行选择时,可为连续或离散值。
7
+ ## 代码演示
@@ -0,0 +1,13 @@
1
+ <cn>
2
+ #### 垂直
3
+ 垂直方向的 Slider。
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <div style="height:256px">
9
+ <Slider value="30" direction="vertical"/>
10
+ <Slider value="30" direction="vertical" disabled/>
11
+ </div>
12
+ </template>
13
+ ```
@@ -0,0 +1,7 @@
1
+ ### Slider API
2
+ | 属性 | 说明 | 类型 | 默认值 |
3
+ | ------ | -------------------------------------------------------------------------- | ----------------------------------------------- | ------ |
4
+ | min | 最小值 | number | 0 |
5
+ | max | 最大值 | number | 100 |
6
+ | step | 间距大小 | 步长,取值必须大于 0,并且可被 (max - min) 整除 | 1 |
7
+ | change | 当 Slider 的值发生改变时,会触发 change 事件,并把改变后的值作为参数传入。 | Function | - |
@@ -0,0 +1,58 @@
1
+ export default {
2
+ props: {
3
+ value: [String, Number],
4
+ min: { type: [Number, String], default: 0 },
5
+ max: { type: [Number, String], default: 100 },
6
+ disabled: Boolean,
7
+ step: {
8
+ type: [Number, String],
9
+ default: 1,
10
+ validator: (val) => val > 0
11
+ },
12
+ direction: {
13
+ //todo:
14
+ type: String,
15
+ default: 'horizontal',
16
+ validator: (val) => ['horizontal', 'vertical'].indexOf(val) >= 0
17
+ }
18
+ },
19
+ data() {
20
+ return {
21
+ defaultValue: this.value || 0,
22
+ timer: null,
23
+ }
24
+ },
25
+ methods: {
26
+ change(e) {
27
+ let value = e.target.value * 1
28
+ this.defaultValue = value
29
+ this.$emit('input', value)
30
+
31
+ clearTimeout(this.timer)
32
+ this.timer = setTimeout(() => {
33
+ this.$emit('change', value)
34
+ }, 300);
35
+ }
36
+ },
37
+ render() {
38
+ let { min, max, step, disabled, direction } = this
39
+ let props = {
40
+ class: 'k-slider-bar',
41
+ attrs: {
42
+ min, max, step,
43
+ value: this.defaultValue,
44
+ type: 'range',
45
+ disabled,
46
+ },
47
+ style: {
48
+ 'background': `linear-gradient(to right, #3a95ff ${(this.defaultValue - min) / (max - min) * 100}%, rgba(255, 255, 255, 0.3) 0%)`
49
+ },
50
+ on: {
51
+ input: this.change
52
+ }
53
+ }
54
+ // todo: 懒得写, 用input range 替代, 等需求复杂了, 再继续写更多
55
+ return <div class={['k-slider', { 'k-slider-disabled': disabled }]}><input {...props} /></div>
56
+ }
57
+
58
+ }
@@ -1,35 +1,63 @@
1
+ @import '../../styles/global.less';
1
2
  .k-slider {
2
- .k-slider-wrap {
3
- width: 100%;
4
- height: 6px;
5
- margin: 16px 0;
6
- background-color: #e9eaec;
7
- border-radius: 3px;
8
- vertical-align: middle;
9
- position: relative;
10
- cursor: pointer;
11
- .k-slider-bar {
12
- height: 6px;
13
- background-color: @main;
14
- border-radius: 3px;
15
- // border-top-left-radius: 3px;
16
- // border-bottom-left-radius: 3px;
17
- }
18
- .k-slider-button {
19
- width: 16px;
20
- height: 16px;
21
- border: 2px solid #57a3f3;
22
- border-radius: 50%;
23
- background-color: #fff;
24
- transition: all .2s linear;
25
- outline: 0;
26
- // transform: translate(-50%,-50%);
27
- top:0;
28
- position: absolute;
29
- // left: 50%;
30
- &:hover{
31
- // transform:translateX(-50%) scale(1.2)
32
- }
33
- }
3
+ width: 100%;
4
+ display: inline-block;
5
+ position: relative;
6
+ height: 12px;
7
+ font-size: 0;
8
+ &::before {
9
+ content: '';
10
+ position: absolute;
11
+ height: 4px;
12
+ border-radius: 2px;
13
+ background: @border-color;
14
+ top: 4px;
15
+ width: 100%;
16
+ left: 0;
17
+ }
18
+ .k-slider-bar {
19
+ position: relative;
20
+ z-index: 1;
21
+ margin-top: 4px;
22
+ -webkit-appearance: none;
23
+ // background: linear-gradient(to right, #1CE4FF 41.6777%, rgba(255, 255, 255, 0.3) 0%);
24
+ border-radius: 3px;
25
+ width: 100%;
26
+ // 轨道
27
+ &::-webkit-slider-runnable-track {
28
+ height: 4px;
29
+ border-radius: 3px;
30
+ // box-shadow: 0 1px 1px #def3f8, inset 0 .125em .125em #0d1112;
31
+ // background: @border-color;
32
+ border-radius: 2px;
34
33
  }
34
+ //滑块
35
+ &::-webkit-slider-thumb {
36
+ -webkit-appearance: none;
37
+ height: 12px;
38
+ width: 12px;
39
+ margin-top: -4px;
40
+ // background: @main;
41
+ border-radius: 50%;
42
+ border: 2px solid @main;
43
+ background-color: @back-color;
44
+
45
+ cursor: pointer;
46
+ }
47
+ &:disabled {
48
+ cursor: not-allowed;
49
+ }
50
+ &:focus {
51
+ &::-webkit-slider-thumb {
52
+ box-shadow: 0 0 0px 5px fadeout(@main,80%);
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ .k-slider-disabled {
59
+ opacity: .5;
60
+ // {
61
+ // -webkit-appearance: slider-vertical;
62
+ // }
35
63
  }
@@ -0,0 +1,46 @@
1
+ <cn>
2
+ #### 对齐
3
+ 设置对齐模式。
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <div class="demo-space">
9
+ Align start
10
+ <Space align="start">
11
+ <Button size="large">large</Button>
12
+ <Button>default</Button>
13
+ <Button size="small">small</Button>
14
+ Start text
15
+ </Space>
16
+ <br/>
17
+ <br/>
18
+ Align end
19
+ <Space align="end">
20
+ <Button size="large">large</Button>
21
+ <Button>default</Button>
22
+ <Button size="small">small</Button>
23
+ End text
24
+ </Space>
25
+ <br/>
26
+ <br/>
27
+ Align center
28
+ <Space align="center">
29
+ <Button size="large">large</Button>
30
+ <Button>default</Button>
31
+ <Button size="small">small</Button>
32
+ Center text
33
+ </Space>
34
+ <br/>
35
+ <br/>
36
+ Align baseline
37
+ <Space align="start">
38
+ <Button>button</Button>
39
+ <span style="background:#eee">Baseline text</span>
40
+ </Space>
41
+ </div>
42
+ </template>
43
+ <style scoped>
44
+
45
+ </style>
46
+ ```
@@ -0,0 +1,20 @@
1
+ <cn>
2
+ #### 基本用法
3
+ 相邻组件水平间距。
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <Space>
9
+ Space
10
+ <Button>Button</Button>
11
+ <Button icon="search">Button</Button>
12
+ <Tooltip placement="top">
13
+ <Button>Space</Button>
14
+ <template slot="title">
15
+ <p>I am space</p>
16
+ </template>
17
+ </Tooltip>
18
+ </Space>
19
+ </template>
20
+ ```
@@ -0,0 +1,35 @@
1
+ <cn>
2
+ #### 自定义尺寸
3
+ 自定义间距大小。
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <div>
9
+ <Slider v-model="size" max="50"/>
10
+ <br/>
11
+ <br/>
12
+ <Space :size="size">
13
+ <Button type="primary">Primary</Button>
14
+ <Button type="danger">Danger</Button>
15
+ <Button>Default</Button>
16
+ <Button type="dashed">Dashed</Button>
17
+ <Button type="link">Link</Button>
18
+ </Space>
19
+ </div>
20
+ </template>
21
+ <script>
22
+ export default {
23
+ data() {
24
+ return {
25
+ size: 12,
26
+ };
27
+ },
28
+ methods:{
29
+ change(e){
30
+ this.size =e.target.value*1
31
+ }
32
+ }
33
+ };
34
+ </script>
35
+ ```