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

View File

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