File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed
Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -516,15 +516,21 @@ export default {
516516::: demo
517517
518518``` html
519- <el-button @click =" onSyncUpdate" >异步更新 </el-button >
519+ <el-button @click =" onSyncUpdate" >Append </el-button >
520520<el-button @click =" onSetOptions" >SetOptions</el-button >
521521<el-edit-table ref =" form" :columns =" columns" v-model =" data" ></el-edit-table >
522522
523523<script >
524524 export default {
525525 data () {
526526 return {
527- data: [],
527+ id: 1 ,
528+ data: [
529+ {
530+ id: ` 第 1 行` ,
531+ option: ' ' ,
532+ },
533+ ],
528534 columns: [
529535 {
530536 id: ' id' ,
@@ -549,20 +555,12 @@ export default {
549555 },
550556 methods: {
551557 onSyncUpdate () {
552- this . data = [
553- {
554- id: ' 第 1 行 ' ,
558+ for ( let i = 0 ; i < 3 ; i ++ ) {
559+ this . data . push ( {
560+ id: ` 第 ${ ++ this . id } 行 ` ,
555561 option: ' ' ,
556- },
557- {
558- id: ' 第 2 行' ,
559- option: ' ' ,
560- },
561- {
562- id: ' 第 3 行' ,
563- option: ' ' ,
564- },
565- ]
562+ })
563+ }
566564 },
567565 onSetOptions () {
568566 this .data .forEach ((e , i ) => {
Original file line number Diff line number Diff line change @@ -171,6 +171,8 @@ export default {
171171 value (v ) {
172172 this .resetRowOptionsData (v, this .oldValue );
173173
174+ this .oldValue = [... v];
175+
174176 this .indexKeys = v .map ((_ , i ) => i);
175177 }
176178 },
@@ -207,7 +209,6 @@ export default {
207209 },
208210
209211 updateValue (value ) {
210- this .oldValue = [... this .model .data ];
211212 this .$emit (' input' , value);
212213 },
213214
You can’t perform that action at this time.
0 commit comments