提交 de877f47 authored 作者: matian's avatar matian

fix:修改更新分类传参问题

上级 dffcb0db
...@@ -78,8 +78,9 @@ const handleCancel = () => { ...@@ -78,8 +78,9 @@ const handleCancel = () => {
} }
// 确认提交表单 // 确认提交表单
const handleConfirm = () => { const handleConfirm = () => {
console.log(props.isEdit, '00000')
if (props.isEdit) { if (props.isEdit) {
const params = Object.assign({ id: props.editData.idd }, categoryForm) const params = Object.assign({ id: props.editData.id }, categoryForm)
updateCategory(params).then(() => { updateCategory(params).then(() => {
ElMessage.success('更新类别成功') ElMessage.success('更新类别成功')
emit('update:dialogVisible', false) emit('update:dialogVisible', false)
...@@ -96,7 +97,7 @@ const handleConfirm = () => { ...@@ -96,7 +97,7 @@ const handleConfirm = () => {
} }
onMounted(() => { onMounted(() => {
console.log(props.prevCategoryName, 'props.prevCategoryName') console.log(props.editData.id, '0000')
categoryForm.depth = parseInt(props.editData?.depth) + 1 || 0 categoryForm.depth = parseInt(props.editData?.depth) + 1 || 0
categoryForm.parent_id = props.editData?.id categoryForm.parent_id = props.editData?.id
categoryName.value = props.prevCategoryName categoryName.value = props.prevCategoryName
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论