修复切换组件时,数据的设置数据不更新的问题
This commit is contained in:
@@ -15,7 +15,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
records: [],
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
@@ -44,7 +43,8 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
columns: v => v.configs
|
||||
columns: v => v.configs,
|
||||
records: v => v.tableData.map(e => ({$cellEdit: true, ...e}))
|
||||
},
|
||||
methods: {
|
||||
rowSave(form, done) {
|
||||
@@ -74,16 +74,13 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.records = this.tableData.map(e => ({$cellEdit: true, ...e}))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="tableEditor">
|
||||
<avue-crud :option="option" :data="records" @row-save="rowSave" @row-cancel="rowSave" @row-del="rowDel">
|
||||
<template v-for="c in columns" :slot="`${c.prop}Header`" slot-scope="{column = {}}">
|
||||
<template v-for="col in columns" :slot="`${col.prop}Header`" slot-scope="{column = {}}">
|
||||
<el-input class="headerInput" v-model="column.label" clearable placeholder="请输入列名" @change="$emit('update:configs', columns)"/>
|
||||
</template>
|
||||
<template v-if="label" v-slot:menuLeft>
|
||||
|
||||
Reference in New Issue
Block a user