kui-vue 3.3.12 → 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.
Files changed (48) hide show
  1. package/components/_tool/transfer.js +5 -5
  2. package/components/_tool/utils.js +0 -135
  3. package/components/base/drop.jsx +230 -17
  4. package/components/base/pop.jsx +1 -1
  5. package/components/button/styles/index.less +1 -0
  6. package/components/checkbox/styles/index.less +7 -3
  7. package/components/colorPicker/colorpicker.jsx +4 -3
  8. package/components/colorPicker/styles/index.less +16 -25
  9. package/components/datePicker/datepicker.jsx +5 -2
  10. package/components/datePicker/index.md +0 -1
  11. package/components/datePicker/styles/datepicker.less +1 -0
  12. package/components/drawer/demo/form.md +4 -2
  13. package/components/drawer/styles/index.less +9 -2
  14. package/components/dropdown/index.md +0 -1
  15. package/components/dropdown/styles/index.less +4 -0
  16. package/components/form/demo/align.md +1 -1
  17. package/components/form/demo/base.md +1 -1
  18. package/components/form/demo/dynamicvalid.md +1 -1
  19. package/components/form/demo/length.md +2 -2
  20. package/components/form/demo/valid.md +2 -2
  21. package/components/input/styles/index.less +29 -20
  22. package/components/inputNumber/styles/index.less +3 -3
  23. package/components/menu/demo/inline.md +4 -4
  24. package/components/menu/styles/index.less +1 -1
  25. package/components/popconfirm/index.md +0 -1
  26. package/components/popconfirm/styles/index.less +4 -2
  27. package/components/poptip/demo/closeinside.md +1 -1
  28. package/components/poptip/index.md +1 -2
  29. package/components/poptip/styles/index.less +10 -5
  30. package/components/radio/styles/index.less +22 -3
  31. package/components/rate/styles/index.less +9 -1
  32. package/components/select/demo/base.md +1 -1
  33. package/components/select/demo/multiple.md +1 -1
  34. package/components/select/demo/theme.md +11 -13
  35. package/components/select/index.md +0 -1
  36. package/components/select/select.jsx +64 -34
  37. package/components/select/styles/index.less +144 -128
  38. package/components/styles/color.less +17 -12
  39. package/components/styles/var.less +7 -0
  40. package/components/table/demo/edit.md +34 -12
  41. package/components/table/styles/index.less +87 -38
  42. package/components/table/table.jsx +1 -1
  43. package/components/tooltip/index.md +1 -4
  44. package/components/tooltip/styles/index.less +8 -4
  45. package/dist/k-ui.css +2 -2
  46. package/dist/k-ui.js +2 -2
  47. package/package.json +2 -2
  48. /package/{README.md → readme.md} +0 -0
@@ -8,21 +8,27 @@
8
8
  box-sizing: border-box;
9
9
  vertical-align: middle;
10
10
  color: var(--kui-color-font);
11
- font-size: 12px;
11
+ font-size: 14px;
12
12
  position: relative;
13
13
  outline: none;
14
14
  box-sizing: border-box;
15
15
  flex-shrink: 0;
16
-
17
- &:focus {
18
- .k-select-selection {
19
- border: 1px solid var(--kui-color-border);
20
- box-shadow: 0 0 0 2px var(--kui-color-main-90);
21
- }
16
+ align-items: center;
17
+ background-color: var(--kui-color-back);
18
+ border-radius: var(--kui-border-radius);
19
+ border: 1px solid var(--kui-color-border);
20
+ padding-left: 8px;
21
+ transition: border .3s ease-in-out;
22
+ &:hover {
23
+ // .k-select-selection {
24
+ border-color: var(--kui-color-main); // border-color: #3bb4f2;
25
+ // border: 1px solid var(--kui-color-border);
26
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
27
+ // }
22
28
  }
23
29
 
24
30
  &-selection {
25
- border-radius: var(--kui-border-radius);
31
+
26
32
  box-sizing: border-box;
27
33
  outline: 0;
28
34
  -webkit-user-select: none;
@@ -31,10 +37,9 @@
31
37
  user-select: none;
32
38
  cursor: pointer;
33
39
  position: relative;
34
- border: 1px solid var(--kui-color-border);
35
- min-height: 32px;
40
+ min-height: 30px;
36
41
  position: relative;
37
- transition: all .25s ease-in-out;
42
+ // transition: all .25s ease-in-out;
38
43
  display: inline-flex;
39
44
  align-items: center;
40
45
  width: 100%;
@@ -45,19 +50,17 @@
45
50
  }
46
51
 
47
52
  .k-select-icon {
48
- margin-left: 8px;
49
53
  font-size: 16px;
50
54
  color: var(--kui-color-icon);
55
+ margin-right: 5px;
51
56
  }
52
57
 
53
58
  &-search-wrap {
54
59
  position: absolute;
55
- // left: 5px;
56
60
  z-index: 1;
57
- top: 50%;
61
+ // top: 50%;
58
62
  background: none;
59
- margin-left: 9px;
60
- transform: translateY(-50%);
63
+ // transform: translateY(-50%);
61
64
  overflow: hidden;
62
65
  max-width: 100%;
63
66
 
@@ -65,8 +68,8 @@
65
68
  .k-select-search {
66
69
  // border: 1px solid #eee;
67
70
  border: none;
68
- width: 0.75em;
69
- min-width: 0.75em;
71
+ width: 7px;
72
+ min-width: 7px;
70
73
  height: 22px;
71
74
  padding: 0;
72
75
  background: none;
@@ -77,21 +80,25 @@
77
80
  }
78
81
 
79
82
  &-labels {
80
- padding: 0 32px 0 4px;
81
- transition: all .25s ease-in-out;
83
+ transition: font-size .25s ease-in-out;
82
84
  overflow: hidden;
85
+ display: flex;
86
+ flex-wrap: wrap;
87
+ gap: 3px;
88
+ margin: 3px 0;
83
89
 
84
90
  .k-select-tag {
85
91
  padding: 2px 22px 2px 5px;
86
92
  border: 1px solid var(--kui-color-border);
87
93
  border-radius: var(--kui-border-radius);
88
- margin: 3px 5px 3px 0;
89
- display: inline-block;
94
+ display: inline-flex;
95
+ align-items: center;
90
96
  font-size: 12px;
91
97
  position: relative;
92
98
  line-height: 18px;
93
99
  transition: all .25s ease-in-out;
94
100
 
101
+ // overflow: hidden;
95
102
  .k-icon {
96
103
  position: absolute;
97
104
  right: 3px;
@@ -111,10 +118,10 @@
111
118
  display: inline-block;
112
119
  position: relative;
113
120
  transform: none;
114
- padding: 3px 5px;
121
+ // padding: 3px 0;
115
122
  left: 0;
116
123
  top: 0;
117
- margin: 0 0 0 5px;
124
+ margin: 0;
118
125
  vertical-align: middle;
119
126
  // .k-select-search {
120
127
  // // border: none;
@@ -140,117 +147,124 @@
140
147
  }
141
148
 
142
149
  &-placeholder {
143
- position: absolute;
144
- left: 0;
145
- top: 0;
146
- font-size: 12px;
150
+ // position: absolute;
151
+ // left: 0;
152
+ // top: 0;
153
+ font-size: 14px;
147
154
  z-index: 0;
148
- padding-left: 9px;
149
155
  padding-right: 30px;
150
156
  overflow: hidden;
151
157
  text-overflow: ellipsis;
152
158
  color: var(--kui-color-disable-color);
153
- top: 50%;
154
- transform: translateY(-50%);
159
+ // top: 50%;
160
+ // transform: translateY(-50%);
155
161
  white-space: nowrap;
156
162
  max-width: 100%;
157
163
  box-sizing: border-box;
158
- transition: all .25s ease-in-out;
164
+ transition: font-size .25s ease-in-out;
165
+ line-height: 1;
159
166
  }
160
167
 
161
- /* .k-select-placeholder {
162
- color: #888;
163
- } */
164
- /* .k-select-placeholder, */
165
168
  &-label {
166
169
  display: block;
167
- // height: 30px;
168
- // line-height: 30px;
169
170
  overflow: hidden;
170
171
  text-overflow: ellipsis;
171
172
  white-space: nowrap;
172
- // padding-top: -1px;
173
- padding-left: 8px;
174
- padding-right: 32px;
175
173
  border: none;
176
174
  background: transparent;
177
175
  box-sizing: border-box;
178
176
  width: 100%;
179
177
  cursor: pointer;
180
- font-size: 12px;
181
- transition: all .25s ease-in-out;
178
+ font-size: 14px;
179
+ transition: font-size .25s ease-in-out;
182
180
  }
183
181
 
184
182
  &-arrow {
185
183
  // font-size: 18px;
186
- position: absolute;
187
- top: 50%;
188
- right: 9px;
184
+ // position: absolute;
185
+ // top: 50%;
186
+ // right: 9px;
189
187
  font-size: 14px;
190
188
  box-sizing: border-box;
191
- transform: translateY(-50%) rotate(0deg);
189
+ transform: rotate(0deg);
192
190
  transform-origin: center;
193
191
  transition: transform .3s ease-in-out;
194
192
  transition: all .25s ease-in-out;
195
193
  color: var(--kui-color-icon);
196
-
194
+ margin: 0 8px;
197
195
  #chevron-up {
198
196
  transform: rotate(180deg);
199
197
  }
200
198
  }
201
199
 
202
200
  &-clearable {
203
- position: absolute;
204
- top: 50%;
205
- right: 9px;
206
- transform: translateY(-50%);
201
+ // position: absolute;
202
+ // top: 50%;
203
+ // right: 9px;
204
+ // transform: translateY(-50%);
207
205
  display: none;
208
206
  font-size: 15px;
209
207
  color: var(--kui-color-icon);
210
-
208
+ margin: 0 8px;
211
209
  &:hover {
212
210
  color: var(--kui-color-font);
213
211
  }
214
212
  }
215
213
 
216
- &:hover,
217
- &:focus {
218
- .k-select-selection {
219
- border-color: var(--kui-color-main);
220
- }
221
- }
222
214
 
223
- .k-select-placeholder {
215
+ .k-select-search-mirror,
216
+ .k-select-search {
224
217
  font-size: 14px;
225
- line-height: 1;
218
+ color: var(--kui-color-font);
226
219
  }
227
220
 
228
- .k-select-label {
229
- font-size: 14px;
221
+
222
+
223
+ &.k-select-circle {
224
+ // .k-select-selection {
225
+ border-radius: 30px;
226
+ // }
230
227
  }
228
+ }
231
229
 
232
- .k-select-search-mirror,
233
- .k-select-search {
234
- font-size: 14px;
235
- color: var(--kui-color-font);
230
+ .k-select-show-tags {
231
+ padding-left: 4px;
232
+
233
+ .k-select-icon {
234
+ margin-left: 4px;
236
235
  }
237
236
  }
238
237
 
239
- .k-select-has-icon {
238
+ .k-select-show-search {
240
239
  .k-select-placeholder {
241
- left: 20px;
240
+ position: absolute;
242
241
  }
242
+ }
243
243
 
244
- .k-select-selection>.k-select-search-wrap {
245
- left: 20px;
244
+ .k-select-multiple {
245
+ .k-select-selection {
246
+ // padding-left: 4px;
247
+ }
248
+
249
+ .k-select-placeholder {
250
+ position: absolute;
251
+ // padding-left: 4px;
252
+ }
253
+ }
254
+
255
+ .k-select-has-icon {
256
+ .k-select-placeholder {
257
+ // left: 20px;
246
258
  }
247
259
  }
248
260
 
249
261
  .k-select-light {
250
- .k-select-selection {
262
+ &.k-select {
251
263
  border-color: transparent;
252
264
  background: var(--kui-color-gray-80);
253
- border-radius: var(--kui-border-radius);
265
+ // border-radius: var(--kui-border-radius);
266
+ transition: none;
267
+ box-shadow: none;
254
268
 
255
269
  &:focus,
256
270
  &:hover {
@@ -270,11 +284,7 @@
270
284
  }
271
285
  }
272
286
 
273
- .k-select-circle {
274
- .k-select-selection {
275
- border-radius: 30px;
276
- }
277
- }
287
+
278
288
 
279
289
  .k-select-dropdown {
280
290
  user-select: none;
@@ -358,7 +368,7 @@
358
368
  .k-select-item-selected {
359
369
  background: var(--kui-color-selected);
360
370
  // color: var(--kui-color-main);
361
- font-weight: bold;
371
+ font-weight: 500;
362
372
 
363
373
  &:hover {
364
374
  background: var(--kui-color-selected);
@@ -390,22 +400,40 @@
390
400
  }
391
401
 
392
402
  .k-select-sm {
403
+ padding-left: 4px;
404
+
393
405
  .k-select-icon {
394
406
  font-size: 14px;
395
- margin-left: 4px;
407
+ margin-right: 3px;
396
408
  }
397
409
 
398
410
  .k-select-selection {
399
- min-height: 24px;
411
+ min-height: 22px;
412
+ // padding-left: 5px;
413
+ }
414
+
415
+ // &.k-select-multiple {
416
+ // .k-select-selection {
417
+ // padding-left: 2px;
418
+ // }
419
+ // }
420
+ &.k-select-show-tags {
421
+ padding-left: 2px;
422
+
423
+ .k-select-icon {
424
+ margin-left: 2px;
425
+ }
400
426
  }
401
427
 
402
428
  .k-select-arrow {
403
429
  font-size: 12px;
404
- right: 5px;
430
+ // right: 5px;
431
+ margin: 0 4px;
405
432
  }
406
433
 
407
434
  .k-select-clearable {
408
- right: 5px;
435
+ // right: 5px;
436
+ margin: 0 4px;
409
437
  font-size: 12px;
410
438
  }
411
439
 
@@ -422,17 +450,18 @@
422
450
 
423
451
  .k-select-search-wrap {
424
452
  .k-select-search {
425
- height: 18px;
453
+ height: 12px;
426
454
  font-size: 12px;
427
455
  }
428
456
  }
429
457
 
430
458
  .k-select-labels {
431
- padding: 0 23px 0 3px;
459
+ gap: 2px;
460
+ margin: 2px 0;
432
461
 
433
462
  .k-select-tag {
434
463
  padding: 2px 20px 2px 5px;
435
- margin: 2px 3px 2px 0;
464
+ // margin: 2px 3px 2px 0;
436
465
  line-height: 1;
437
466
 
438
467
  .k-icon {
@@ -445,8 +474,8 @@
445
474
 
446
475
  .k-select-search {
447
476
  font-size: 12px;
448
- height: 18px;
449
- line-height: 18px;
477
+ height: 12px;
478
+ line-height: 12px;
450
479
  left: 0;
451
480
  float: left;
452
481
  }
@@ -461,11 +490,11 @@
461
490
 
462
491
  &.k-select-has-icon {
463
492
  .k-select-selection>.k-select-search-wrap {
464
- left: 14px;
493
+ // left: 14px;
465
494
  }
466
495
 
467
496
  .k-select-placeholder {
468
- left: 14px;
497
+ // left: 14px;
469
498
  }
470
499
  }
471
500
  }
@@ -477,16 +506,20 @@
477
506
 
478
507
  .k-select-selection {
479
508
  font-size: 16px;
480
- min-height: 40px;
509
+ min-height: 38px;
510
+ }
511
+
512
+ .k-select-icon {
513
+ font-size: 18px;
481
514
  }
482
515
 
483
516
  .k-select-arrow {
484
517
  font-size: 18px;
485
- right: 10px;
518
+ // right: 10px;
486
519
  }
487
520
 
488
521
  .k-select-clearable {
489
- right: 10px;
522
+ // right: 10px;
490
523
  font-size: 18px;
491
524
  }
492
525
 
@@ -494,7 +527,6 @@
494
527
  line-height: 38px;
495
528
  height: 38px;
496
529
  font-size: 16px;
497
- padding-right: 32px;
498
530
  }
499
531
 
500
532
  .k-select-search-wrap {
@@ -504,11 +536,10 @@
504
536
  }
505
537
 
506
538
  .k-select-labels {
507
- padding: 0 32px 0 6px;
508
539
 
509
540
  .k-select-tag {
510
541
  padding: 7px 20px 7px 5px;
511
- margin: 4px 8px 4px 0;
542
+ // margin: 4px 8px 4px 0;
512
543
  font-size: 14px;
513
544
  line-height: 1;
514
545
 
@@ -518,7 +549,7 @@
518
549
  }
519
550
 
520
551
  .k-select-search-wrap {
521
- padding: 4px 0;
552
+ // padding: 4px 0;
522
553
 
523
554
  .k-select-search {
524
555
  height: 28px;
@@ -532,10 +563,14 @@
532
563
  }
533
564
 
534
565
  .k-select-open {
535
- .k-select-selection {
536
- border-color: var(--kui-color-main); // border-color: #3bb4f2;
537
- // box-shadow: 0 0 5px rgba(59, 180, 242, 0.55);
538
- box-shadow: 0 0 0 2px var(--kui-color-main-90);
566
+ // .k-select-selection {
567
+ border-color: var(--kui-color-main); // border-color: #3bb4f2;
568
+ // box-shadow: 0 0 5px rgba(59, 180, 242, 0.55);
569
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
570
+ // }
571
+
572
+ .k-select-label {
573
+ opacity: .5;
539
574
  }
540
575
 
541
576
  // .k-select-arrow {
@@ -549,13 +584,13 @@
549
584
 
550
585
  .k-select-disabled {
551
586
  color: var(--kui-color-disable-color);
587
+ background: var(--kui-color-disable-back);
552
588
 
553
589
  .k-select-label {
554
590
  cursor: not-allowed;
555
591
  }
556
592
 
557
- .k-select-selection {
558
- background: var(--kui-color-disable-back);
593
+ * {
559
594
  cursor: not-allowed;
560
595
  }
561
596
 
@@ -565,10 +600,10 @@
565
600
 
566
601
  &:hover,
567
602
  &:focus {
568
- .k-select-selection {
569
- border-color: var(--kui-color-disable-border);
570
- box-shadow: none;
571
- }
603
+ // .k-select-selection {
604
+ border-color: var(--kui-color-disable-border);
605
+ box-shadow: none;
606
+ // }
572
607
  }
573
608
  }
574
609
 
@@ -585,13 +620,13 @@
585
620
  }
586
621
 
587
622
  .k-select-borderless {
623
+ border-color: transparent;
624
+ box-shadow: none;
588
625
 
589
626
  &:hover,
590
627
  &:focus {
591
- .k-select-selection {
592
628
  border-color: transparent;
593
629
  box-shadow: none;
594
- }
595
630
  }
596
631
 
597
632
  .k-select-selection {
@@ -601,25 +636,6 @@
601
636
  }
602
637
  }
603
638
 
604
- @keyframes k-select-slide {
605
- from {
606
- opacity: 0;
607
- transform: scale(0, 0);
608
- }
609
-
610
- to {
611
- opacity: 1;
612
- transform: scale(1, 1);
613
- }
614
- }
615
-
616
- .k-select-tag-enter-active {
617
- animation: k-select-slide .3s ease-out;
618
- }
619
-
620
- .k-select-tag-leave-active {
621
- animation: k-select-slide .3s ease-out reverse;
622
- }
623
639
 
624
640
  @keyframes drop-down {
625
641
  0% {
@@ -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