Fix category tree select bug

pull/9/head
johnniang 2019-05-04 16:29:56 +08:00
parent 4d5d5a5926
commit 4613ecd8d1
2 changed files with 5 additions and 6 deletions

View File

@ -89,7 +89,7 @@
> >
<a <a
href="javascript:;" href="javascript:;"
@click="handleEditCategory(record.id)" @click="handleEditCategory(record)"
>编辑</a> >编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm <a-popconfirm
@ -179,11 +179,9 @@ export default {
this.formType = 'create' this.formType = 'create'
this.categoryToCreate = {} this.categoryToCreate = {}
}, },
handleEditCategory(id) { handleEditCategory(category) {
categoryApi.get(id).then(response => { this.categoryToCreate = category
this.categoryToCreate = response.data.data
this.formType = 'update' this.formType = 'update'
})
}, },
handleDeleteCategory(id) { handleDeleteCategory(id) {
categoryApi.delete(id).then(response => { categoryApi.delete(id).then(response => {

View File

@ -5,6 +5,7 @@
treeDefaultExpandAll treeDefaultExpandAll
:treeDataSimpleMode="true" :treeDataSimpleMode="true"
:allowClear="true" :allowClear="true"
:value="categoryId"
@change="handleSelectionChange" @change="handleSelectionChange"
> >
</a-tree-select> </a-tree-select>