bugfix: 删除sketch
This commit is contained in:
@@ -57,13 +57,15 @@
|
||||
// VersionTreeIndexRef.value.getVersionTree()
|
||||
}
|
||||
|
||||
const handleDeleteSketch = (deletedId: string) => {
|
||||
sketchList.value = sketchList.value.filter((item) => {
|
||||
if (typeof item === 'object') {
|
||||
return Object.keys(item)[0] !== deletedId
|
||||
}
|
||||
return true
|
||||
})
|
||||
const handleDeleteSketch = (id) => {
|
||||
sketchList.value = sketchList.value
|
||||
.map((sketchItem) => {
|
||||
if (sketchItem.hasOwnProperty(id)) {
|
||||
delete sketchItem[id]
|
||||
}
|
||||
return sketchItem
|
||||
})
|
||||
.filter((sketchItem) => Object.keys(sketchItem).length > 0)
|
||||
}
|
||||
|
||||
const handleSetTitle = (title: string) => {
|
||||
@@ -93,7 +95,7 @@
|
||||
const handleGetProjectInfoAndHistory = () => {
|
||||
handleOpenSketch()
|
||||
getProjectInfo({ id: route.params.id }).then((res) => {
|
||||
if(!res) {
|
||||
if (!res) {
|
||||
router.push({ name: 'mainInput' })
|
||||
ElMessage.warning(t('Home.notFound'))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user