kui-vue 3.4.0 → 3.4.1

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.
@@ -20,6 +20,7 @@
20
20
  transition: all .2s;
21
21
  z-index: 0;
22
22
  white-space: nowrap;
23
+ background-color: var(--kui-color-back);
23
24
  cursor: pointer;
24
25
 
25
26
  // &:focus,
@@ -23,10 +23,10 @@
23
23
  }
24
24
 
25
25
  .k-checkbox-inner {
26
- box-sizing: content-box;
26
+ box-sizing: border-box;
27
27
  display: inline-block;
28
- width: 14px;
29
- height: 14px;
28
+ width: 16px;
29
+ height: 16px;
30
30
  position: relative;
31
31
  top: 0;
32
32
  left: 0;
@@ -109,6 +109,10 @@
109
109
  .k-checkbox-label {
110
110
  font-size: 16px;
111
111
  }
112
+ .k-checkbox-inner{
113
+ width: 18px;
114
+ height: 18px;
115
+ }
112
116
  }
113
117
 
114
118
  .k-checkbox-light {
@@ -8,7 +8,6 @@
8
8
  | pickerSize | 值Ï为`small`时日期呈现小尺寸 | String | - |
9
9
  | clearable | 是否显示清除图标 | Boolean | true |
10
10
  | placeholder | 提示语 | String, Array | - |
11
- | transfer | 默认渲染到body 上,如定位有问题,请尝试修改为 false | Boolean | true |
12
11
  | disabledDate | 不可选择的日期 | Function | - |
13
12
  | disabledTime | 不可选择的时间 | Function | - |
14
13
  | format | 设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [dayjs](http://day.js.org/) | String | YYYY-MM-DD |
@@ -14,6 +14,7 @@
14
14
  border: 1px solid var(--kui-color-border);
15
15
  min-height: 32px;
16
16
  border-radius: var(--kui-border-radius);
17
+ background-color: var(--kui-color-back);
17
18
  cursor: default;
18
19
  user-select: none;
19
20
  // min-width: 135px;
@@ -11,13 +11,13 @@
11
11
  <Drawer v-model="show1" title="表单验证" @ok="submitForm" @cancel="resetForm" footer>
12
12
  <Form ref="form" :model="form" :rules="rules" label-align="left" :labelCol="{span:5}" :wrapperCol="{span:19}">
13
13
  <FormItem label="Input" prop="input">
14
- <Input clearable icon="home"></Input>
14
+ <Input clearable :icon="Home"></Input>
15
15
  </FormItem>
16
16
  <FormItem label="Number" prop="number">
17
17
  <Input number clearable></Input>
18
18
  </FormItem>
19
19
  <FormItem label="DatePicker" prop="datepicker">
20
- <DatePicker clearable format="YYYY/MM/DD hh:mm:ss"></DatePicker>
20
+ <DatePicker clearable format="YYYY/MM/DD hh:mm:ss" style="width:210px"></DatePicker>
21
21
  </FormItem>
22
22
  <FormItem label="Radio" prop="radio">
23
23
  <Radio >男</Radio>
@@ -56,9 +56,11 @@
56
56
  </div>
57
57
  </template>
58
58
  <script>
59
+ import { Home } from 'kui-icons'
59
60
  export default {
60
61
  data() {
61
62
  return {
63
+ Home,
62
64
  show1: false, show2: false,
63
65
  form: {
64
66
  switch: true,
@@ -3,6 +3,7 @@
3
3
  .k-drawer {
4
4
  position: fixed;
5
5
  z-index: 1002;
6
+ top: 0;
6
7
  .k-drawer-mask {
7
8
  position: fixed;
8
9
  top: 0;
@@ -14,6 +15,7 @@
14
15
  width: 100%;
15
16
  z-index: 1000; // animation: mmask .5s ease-in-out;
16
17
  overflow: hidden;
18
+ pointer-events: none;
17
19
  }
18
20
  .k-drawer-box {
19
21
  position: absolute;
@@ -43,13 +45,18 @@
43
45
  text-align: center;
44
46
  top: 0;
45
47
  transition: all .3s ease-in-out;
48
+
46
49
  &:hover {
47
- color: var(--kui-color-danger);
50
+ .k-icon{
51
+ color: var(--kui-color-danger);
52
+ background-color: var(--kui-color-gray-80);
53
+ border-radius: var(--kui-border-radius);
54
+ }
48
55
  // transform: rotate(360deg);
49
56
  }
50
57
  }
51
58
  .k-drawer-header {
52
- border-bottom: 1px solid var(--kui-color-gray-80);
59
+ border-bottom: 1px solid var(--kui-color-border);
53
60
  padding: 14px 35px 14px 16px;
54
61
  line-height: 1;
55
62
  font-size: 14px;
@@ -4,5 +4,4 @@
4
4
  | value | 默认是否显示下拉,可使用v-model绑定 | Boolean | hover |
5
5
  | trigger | 触发方式,支持hover(默认), click, custom 3种方式 | String | hover |
6
6
  | placement | 菜单弹出位置:bottomLeft bottomCenter bottomRight topLeft topCenter topRight | String | bottom-left |
7
- | transfer | 默认渲染到body 上,如定位有问题,请尝试修改为 false | Boolean | true |
8
7
  | showPlacementArrow | 是否显示菜单箭头 | Boolean | false |
@@ -10,16 +10,23 @@
10
10
  align-items: center;
11
11
  border: 1px solid var(--kui-color-border);
12
12
  border-radius: var(--kui-border-radius);
13
+ background-color: var(--kui-color-back);
13
14
  transition: all .3s ease-in-out;
14
15
  box-sizing: border-box;
15
16
  font-size: 14px;
16
17
  padding: 0 8px;
17
- gap: 8px;
18
+ gap: 6px;
19
+ height: 32px;
20
+ overflow: hidden;
18
21
 
19
22
  &:hover {
20
23
  border-color: var(--kui-color-main);
21
24
  }
22
25
 
26
+ .k-select {
27
+ padding-left: 0;
28
+ }
29
+
23
30
  .k-input-icon {
24
31
  font-size: 16px;
25
32
  color: var(--kui-color-icon);
@@ -32,9 +39,9 @@
32
39
  .k-input-text {
33
40
  padding-left: 0;
34
41
  border: none;
35
- height: 30px;
36
- line-height: 1.5;
37
- padding: 4px 0;
42
+ // height: 30px;
43
+ line-height: 1;
44
+ padding: 0;
38
45
  font-size: 14px;
39
46
  color: var(--kui-color-font);
40
47
  background-color: transparent;
@@ -90,19 +97,20 @@
90
97
  display: inline-block;
91
98
  width: 100%;
92
99
  height: 32px;
93
- line-height: 1.5;
94
100
  padding: 4px 10px;
95
101
  font-size: 14px;
96
102
  margin: 0;
97
103
  border: 1px solid var(--kui-color-border);
98
104
  border-radius: var(--kui-border-radius);
99
105
  color: var(--kui-color-font);
100
- background-color: transparent;
106
+ // background-color: transparent;
107
+ background-color: var(--kui-color-back);
101
108
  background-image: none;
102
109
  position: relative;
103
110
  cursor: text;
104
111
  transition: border .3s ease-in-out;
105
112
  flex-shrink: 0;
113
+
106
114
  &:focus {
107
115
  // box-shadow: 0 0 5px rgba(59, 180, 242, 0.55);
108
116
  box-shadow: 0 0 0 2px var(--kui-color-main-90);
@@ -154,9 +162,11 @@ select:-webkit-autofill:focus {
154
162
 
155
163
  .k-textarea {
156
164
  max-width: 100%;
165
+ min-height: 32px;
157
166
  height: auto;
158
167
  vertical-align: bottom;
159
168
  font-size: 14px;
169
+ line-height: 1.5;
160
170
  resize: vertical;
161
171
  outline: none;
162
172
  }
@@ -185,21 +195,19 @@ select:-webkit-autofill:focus {
185
195
  }
186
196
 
187
197
  .k-input-sm[single] {
188
- padding: 2px 7px;
189
- height: 22px;
190
- line-height: 22px;
198
+ padding: 2px 4px;
199
+ height: 24px;
191
200
  font-size: 12px;
192
201
  }
193
202
 
194
203
  .k-input-sm[mult] {
195
- padding: 0 6px;
196
- gap: 6px;
204
+ padding: 0 4px;
205
+ gap: 4px;
206
+ height: 24px;
197
207
 
198
208
  .k-input-text {
199
209
  font-size: 12px;
200
210
  padding: 2px 0;
201
- height: 22px;
202
- line-height: 22px;
203
211
  }
204
212
 
205
213
  .k-input-clearable {
@@ -207,7 +215,7 @@ select:-webkit-autofill:focus {
207
215
  }
208
216
 
209
217
  .k-input-icon {
210
- font-size: 16px;
218
+ font-size: 14px;
211
219
  }
212
220
 
213
221
  .k-input-suffix {
@@ -220,15 +228,14 @@ select:-webkit-autofill:focus {
220
228
  .k-input-lg[single] {
221
229
  padding: 2px 10px;
222
230
  height: 38px;
223
- line-height: 38px;
224
231
  font-size: 16px;
225
232
  }
226
233
 
227
234
  .k-input-lg[mult] {
235
+ height: 38px;
236
+
228
237
  .k-input-text {
229
238
  padding: 2px 0;
230
- height: 38px;
231
- line-height: 38px;
232
239
  font-size: 16px;
233
240
  }
234
241
 
@@ -258,11 +265,13 @@ select:-webkit-autofill:focus {
258
265
  .k-input-light[mult],
259
266
  .k-input-light[single],
260
267
  .k-textarea-light {
261
- border: none;
268
+ border-color: transparent;
262
269
  background-color: var(--kui-color-gray-80);
263
270
 
264
271
  &:focus,
272
+ &:hover,
265
273
  &.k-input-focus {
274
+ border-color: transparent;
266
275
  box-shadow: none;
267
276
  }
268
277
  }
@@ -10,6 +10,7 @@
10
10
  align-items: center;
11
11
  border: 1px solid var(--kui-color-border);
12
12
  border-radius: var(--kui-border-radius);
13
+ background-color: var(--kui-color-back);
13
14
  transition: all .3s ease-in-out;
14
15
  box-sizing: border-box;
15
16
  gap: 8px;
@@ -141,10 +142,9 @@
141
142
  }
142
143
 
143
144
  .k-input-number-text {
144
- padding: 2px 0;
145
- height: 22px;
146
- line-height: 22px;
145
+ line-height: 1;
147
146
  font-size: 12px;
147
+ height: 22px;
148
148
  }
149
149
 
150
150
  .k-input-number-clearable {
@@ -8,10 +8,10 @@
8
8
  <div style="width:256px">
9
9
  <Menu v-model="current" :open-keys="openKeys" mode="inline">
10
10
  <SubMenu key="sub1" :icon="Mail" title="Navigation One">
11
- <MenuItem key="1-1">Option 1</MenuItem>
12
- <MenuItem key="1-2">Option 2</MenuItem>
13
- <MenuItem key="1-3">Option 3</MenuItem>
14
- <MenuItem key="1-4">Option 4</MenuItem>
11
+ <MenuItem key="1-1" :icon="Heart">Option 1</MenuItem>
12
+ <MenuItem key="1-2" :icon="Heart">Option 2</MenuItem>
13
+ <MenuItem key="1-3" :icon="Heart">Option 3</MenuItem>
14
+ <MenuItem key="1-4" :icon="Heart">Option 4</MenuItem>
15
15
  </SubMenu>
16
16
  <SubMenu key="sub2" :icon="Heart" title="Navigation Two">
17
17
  <MenuItem key="2-1">Option 5</MenuItem>
@@ -4,7 +4,6 @@
4
4
  | title | 显示的标题 | String,Slots | - |
5
5
  | placement | 提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom` | String | top |
6
6
  | width | 展示的宽度,默认为内容区域的大小 | String | - |
7
- | transfer | 默认渲染到body 上,如定位有问题,请尝试修改为 false | Boolean | true |
8
7
  | ok-text | 确定按钮的文字, | String | 确定 |
9
8
  | cancel-text | 取消按钮的文字, | String | 取消 |
10
9
  | cancel | 点击取消的回调, | Function | - |
@@ -138,7 +138,8 @@
138
138
 
139
139
  .k-popconfirm-content {
140
140
  // .k-popconfirm-inner {
141
- background: var(--kui-color-control-10);
141
+ // background: var(--kui-color-control-10);
142
+ background: #333;
142
143
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
143
144
  border-radius: 12px; //var(--kui-border-radius);
144
145
  position: relative;
@@ -171,7 +172,8 @@
171
172
  position: absolute;
172
173
  box-sizing: border-box;
173
174
  display: flex;
174
- color: var(--kui-color-control-10);
175
+ // color: var(--kui-color-control-10);
176
+ color: #333;
175
177
  width: 24px;
176
178
  height: 7px;
177
179
  }
@@ -5,5 +5,4 @@
5
5
  | title | 显示的标题 | String | - |
6
6
  | content | 显示的正文内容 | slots | - |
7
7
  | placement | 提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom` | String | top |
8
- | width | 展示的宽度,默认为内容区域的大小 | String,Number | - |
9
- | transfer | 默认渲染到body 上,如定位有问题,请尝试修改为 false | Boolean | true |
8
+ | width | 展示的宽度,默认为内容区域的大小 | String,Number | - |
@@ -4,7 +4,8 @@
4
4
  display: inline-block;
5
5
  position: relative;
6
6
  // max-width: 300px;
7
- color: var(--kui-color-font);
7
+ color: #fff;
8
+ // color: var(--kui-color-font);
8
9
  font-size: 12px;
9
10
  line-height: 1.5;
10
11
  position: absolute;
@@ -140,7 +141,8 @@
140
141
  .k-poptip-content {
141
142
  min-width: 200px;
142
143
  // .k-poptip-inner {
143
- background: var(--kui-color-control-10);
144
+ // background: var(--kui-color-control-10);
145
+ background: #333; //var(--kui-color-control-10);
144
146
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
145
147
  border-radius: 8px; // var(--kui-border-radius);
146
148
  position: relative;
@@ -155,7 +157,8 @@
155
157
  .k-poptip-title {
156
158
  font-size: 16px;
157
159
  font-weight: 500;
158
- color: var(--kui-color-font);
160
+ // color: var(--kui-color-font);
161
+ color: #fff;
159
162
  margin: 0;
160
163
  padding: 8px 16px;
161
164
  position: relative;
@@ -170,12 +173,14 @@
170
173
  display: flex;
171
174
  width: 24px;
172
175
  height: 7px;
173
- color: var(--kui-color-control-10);
176
+ color: #333;
177
+ // color: var(--kui-color-control-10);
174
178
  }
175
179
  }
176
180
 
177
181
  .k-poptip-dark {
178
- background-color: var(--kui-color-dark);
182
+ background: #333;
183
+ // background-color: var(--kui-color-dark);
179
184
  color: #fff;
180
185
 
181
186
  .k-poptip-title {
@@ -90,10 +90,10 @@
90
90
  }
91
91
 
92
92
  .k-radio-inner {
93
- box-sizing: content-box;
93
+ box-sizing: border-box;
94
94
  display: inline-block;
95
- width: 14px;
96
- height: 14px;
95
+ width: 16px;
96
+ height: 16px;
97
97
  position: relative;
98
98
  top: 0;
99
99
  left: 0;
@@ -185,6 +185,11 @@
185
185
  .k-radio-label {
186
186
  font-size: 16px;
187
187
  }
188
+
189
+ .k-radio-inner {
190
+ width: 18px;
191
+ height: 18px;
192
+ }
188
193
  }
189
194
 
190
195
  .k-radio-sm {
@@ -231,9 +236,23 @@
231
236
  .k-btn {
232
237
  border: none;
233
238
  border-radius: var(--kui-border-radius);
239
+ height: 24px;
234
240
 
235
241
  &:disabled {
236
242
  background: 0 0;
237
243
  }
244
+
245
+ &:not(.k-btn-primary) {
246
+ background-color: transparent;
247
+ }
238
248
  }
249
+
250
+ .k-btn-lg {
251
+ height: 32px;
252
+ }
253
+
254
+ .k-btn-sm {
255
+ height: 16px;
256
+ }
257
+
239
258
  }
@@ -7,10 +7,10 @@
7
7
  <template>
8
8
  <Space vertical>
9
9
  <Checkbox v-model="checked" label="Shape" />
10
- <Select :width="256" :icon="Search" theme="light" :shape="checked?'circle':''" :options="options" />
10
+ <Select :width="256" clearable :icon="Search" theme="light" :shape="checked?'circle':''" :options="options" />
11
11
  <Select :width="256" clearable filterable theme="light" :shape="checked?'circle':''" :options="options">
12
12
  </Select>
13
- <Select :width="256" :icon="Search" :shape="checked?'circle':''" :options="options" />
13
+ <Select :width="256" clearable :icon="Search" :shape="checked?'circle':''" :options="options" />
14
14
  <Select :width="256" multiple v-model="value" filterable theme="light" :options="options">
15
15
  </Select>
16
16
  </Space>
@@ -12,7 +12,6 @@
12
12
  | clearable | 是否可以清空选项 | Boolean | false |
13
13
  | bordered | 是否显示边框 | Boolean | true |
14
14
  | showArrow | 是否显示下拉按钮 | Boolean | true |
15
- | transfer | 默认渲染到body 上,如定位有问题,请尝试修改为 false | Boolean | true |
16
15
  | change | 在选项状态发生改变时触发,返回选择项{value:xx,label:xx} | Function | - |
17
16
  | open-change | 下拉框展开或收起时触发 | Function | - |
18
17
  | options | options 数据,如果设置则不需要手动构造 Option 节点 | Array <{value,label,disabled}> | [] |
@@ -14,12 +14,11 @@
14
14
  box-sizing: border-box;
15
15
  flex-shrink: 0;
16
16
  align-items: center;
17
-
17
+ background-color: var(--kui-color-back);
18
18
  border-radius: var(--kui-border-radius);
19
19
  border: 1px solid var(--kui-color-border);
20
20
  padding-left: 8px;
21
21
  transition: border .3s ease-in-out;
22
-
23
22
  &:hover {
24
23
  // .k-select-selection {
25
24
  border-color: var(--kui-color-main); // border-color: #3bb4f2;
@@ -38,7 +37,7 @@
38
37
  user-select: none;
39
38
  cursor: pointer;
40
39
  position: relative;
41
- min-height: 32px;
40
+ min-height: 30px;
42
41
  position: relative;
43
42
  // transition: all .25s ease-in-out;
44
43
  display: inline-flex;
@@ -409,7 +408,7 @@
409
408
  }
410
409
 
411
410
  .k-select-selection {
412
- min-height: 24px;
411
+ min-height: 22px;
413
412
  // padding-left: 5px;
414
413
  }
415
414
 
@@ -507,7 +506,7 @@
507
506
 
508
507
  .k-select-selection {
509
508
  font-size: 16px;
510
- min-height: 40px;
509
+ min-height: 38px;
511
510
  }
512
511
 
513
512
  .k-select-icon {
@@ -621,13 +620,13 @@
621
620
  }
622
621
 
623
622
  .k-select-borderless {
623
+ border-color: transparent;
624
+ box-shadow: none;
624
625
 
625
626
  &:hover,
626
627
  &:focus {
627
- .k-select-selection {
628
628
  border-color: transparent;
629
629
  box-shadow: none;
630
- }
631
630
  }
632
631
 
633
632
  .k-select-selection {
@@ -140,23 +140,28 @@
140
140
 
141
141
  @back-color: #fff; //组件背景
142
142
  @back-color-10: #fff;
143
- @back-color-30: darken(#fff, 30%);
144
- @back-color-50: darken(#fff, 50%);
145
- @back-color-60: darken(#fff, 60%);
146
- @back-color-70: darken(#fff, 70%);
147
- @back-color-80: darken(#fff, 80%);
148
- @back-color-90: darken(#fff, 90%);
143
+ @back-color-20: darken(@back-color, 20%);
144
+ @back-color-30: darken(@back-color, 30%);
145
+ @back-color-40: darken(@back-color, 40%);
146
+ @back-color-50: darken(@back-color, 50%);
147
+ @back-color-60: darken(@back-color, 60%);
148
+ @back-color-70: darken(@back-color, 70%);
149
+ @back-color-80: darken(@back-color, 80%);
150
+ @back-color-90: darken(@back-color, 90%);
149
151
 
150
152
  @skeleton-color: @gray-90;
151
153
  @skeleton-min-color: @gray-60;
152
154
 
153
155
  @dark-back-color: #1f1f1f;
154
- @dark-back-color-10: lighten(#1f1f1f, 10%);
155
- @dark-back-color-30: lighten(#1f1f1f, 30%);
156
- @dark-back-color-60: lighten(#1f1f1f, 60%);
157
- @dark-back-color-70: lighten(#1f1f1f, 70%);
158
- @dark-back-color-80: lighten(#1f1f1f, 80%);
159
- @dark-back-color-90: lighten(#1f1f1f, 90%);
156
+ @dark-back-color-10: #252525;//lighten(@dark-back-color, 10%);
157
+ @dark-back-color-20: lighten(@dark-back-color, 20%);
158
+ @dark-back-color-30: lighten(@dark-back-color, 30%);
159
+ @dark-back-color-40: lighten(@dark-back-color, 40%);
160
+ @dark-back-color-50: lighten(@dark-back-color, 50%);
161
+ @dark-back-color-60: lighten(@dark-back-color, 60%);
162
+ @dark-back-color-70: lighten(@dark-back-color, 70%);
163
+ @dark-back-color-80: lighten(@dark-back-color, 80%);
164
+ @dark-back-color-90: lighten(@dark-back-color, 90%);
160
165
 
161
166
  @icon-color: rgba(0, 0, 0, .4); //图标颜色
162
167
  @dark-icon-color: rgba(255, 255, 255, .4);
@@ -119,7 +119,9 @@ html,
119
119
  --kui-color-sub-title: @sub-title-color;
120
120
  --kui-color-back: @back-color;
121
121
  --kui-color-control-10: @back-color-10;
122
+ --kui-color-control-20: @back-color-20;
122
123
  --kui-color-control-30: @back-color-30;
124
+ --kui-color-control-40: @back-color-40;
123
125
  --kui-color-control-50: @back-color-50;
124
126
  --kui-color-control-60: @back-color-60;
125
127
  --kui-color-control-70: @back-color-70;
@@ -149,8 +151,13 @@ html[theme-mode=dark],
149
151
  --kui-color-sub-title: @dark-sub-title-color;
150
152
  --kui-color-back: @dark-back-color;
151
153
  --kui-color-control-10: @dark-back-color-10;
154
+ --kui-color-control-20: @dark-back-color-20;
152
155
  --kui-color-control-30: @dark-back-color-30;
156
+ --kui-color-control-40: @dark-back-color-40;
157
+ --kui-color-control-50: @dark-back-color-50;
153
158
  --kui-color-control-60: @dark-back-color-60;
159
+ --kui-color-control-70: @dark-back-color-70;
160
+ --kui-color-control-80: @dark-back-color-80;
154
161
  --kui-color-control-90: @dark-back-color-90;
155
162
  --kui-color-spin: @dark-spin-color;
156
163
  --kui-color-icon: @dark-icon-color;
@@ -7,14 +7,30 @@
7
7
  <template>
8
8
  <Button @click="add">Add</Button>
9
9
  <Table :data="data" :columns="columns" bordered :sticky="52">
10
- <a slot="name" slot-scope="text">{{text}}</a>
10
+ <a slot="name" slot-scope="text,row">
11
+ <Input v-model="row.name" size="small" v-if="row.isEdit"/>
12
+ <template v-else>{{text}}</template>
13
+ </a>
14
+ <a slot="age" slot-scope="text,row">
15
+ <Input v-model="row.age" size="small" v-if="row.isEdit"/>
16
+ <template v-else>{{text}}</template>
17
+ </a>
18
+ <a slot="address" slot-scope="text,row">
19
+ <Input v-model="row.address" size="small" v-if="row.isEdit"/>
20
+ <template v-else>{{text}}</template>
21
+ </a>
11
22
  <template slot="action" slot-scope="text,row,col">
12
- <Popconfirm
13
- title="您确认删除这条内容吗?"
14
- @ok="e=> removeRow(row.key)"
15
- >
16
- <a href="javascript:;">Delete</a>
17
- </Popconfirm>
23
+ <Space>
24
+ <Button theme="normal" size="small" type="primary" v-if="!row.isEdit" @click="row.isEdit=true">Edit</Button>
25
+ <Button theme="normal" size="small" type="primary" v-if="row.isEdit" @click="save(row)">Save</Button>
26
+ <Button theme="normal" size="small" type="primary" v-if="row.isEdit" @click="row.isEdit=false">Cancel</Button>
27
+ <Popconfirm
28
+ title="您确认删除这条内容吗?"
29
+ @ok="e=> removeRow(row.key)"
30
+ >
31
+ <Button theme="normal" size="small" type="danger">Delete</Button>
32
+ </Popconfirm>
33
+ </Space>
18
34
  </template>
19
35
  </Table>
20
36
  </template>
@@ -23,10 +39,10 @@ export default{
23
39
  data() {
24
40
  return {
25
41
  data:[
26
- { key:'0', name:'Li Lei' ,age:28 , address:'Wu Han Guanggu No. 328' },
27
- { key:'1', name:'Liu Hao' ,age:30 , address:'Wu Han Hongshan No. 128' },
28
- { key:'2', name:'Hu Cong' ,age:28 , address:'Wu Han Nanhu No. 198' },
29
- { key:'3', name:'Chuchur' ,age:32 , address:'Wu Han Nanhu No. 188' },
42
+ { key:'0', name:'Li Lei' ,age:28 , address:'Wu Han Guanggu No. 328',isEdit:false },
43
+ { key:'1', name:'Liu Hao' ,age:30 , address:'Wu Han Hongshan No. 128',isEdit:false },
44
+ { key:'2', name:'Hu Cong' ,age:28 , address:'Wu Han Nanhu No. 198',isEdit:false },
45
+ { key:'3', name:'Chuchur' ,age:32 , address:'Wu Han Nanhu No. 188',isEdit:false },
30
46
  ],
31
47
  columns:[
32
48
 
@@ -39,6 +55,11 @@ export default{
39
55
  }
40
56
  },
41
57
  methods:{
58
+ save(row){
59
+ console.log(row)
60
+ row.isEdit = false
61
+ this.$Message.success('Save successfuly!')
62
+ },
42
63
  removeRow(key){
43
64
  let data = [...this.data]
44
65
  this.data = data.filter(item=> item.key != key)
@@ -50,7 +71,8 @@ export default{
50
71
  key: count ,
51
72
  name: `Name ${count}` ,
52
73
  age: 30,
53
- address: `China Wuhan no.${count}`
74
+ address: `China Wuhan no.${count}`,
75
+ isEdit:false
54
76
  }
55
77
  this.data.push(row)
56
78
  this.count = count