提交 15828470 编写于 作者: View Design's avatar View Design

delte thread

上级 f784bed9
......@@ -38,6 +38,7 @@
<IActionThread
:collection_id="thread.collections.length ? thread.collections[0].collection_id : ''"
:c_id="item.c_id"
@delete="handleDeletedThread"
/>
</div>
</div>
......@@ -57,6 +58,7 @@ const props = defineProps({
default: false
}
})
const emit = defineEmits(['delete'])
const thread = computed(() => {
if (!props.isItem) return props.item
else {
......@@ -97,4 +99,7 @@ watch(()=> Layout.selectCollectData, (data) => {
watch(()=> Layout.removeCollectData, (data) => {
if (data.value !== null) handleRemoveCollect(data)
}, { deep: true })
function handleDeletedThread () {
emit('delete', thread.value.c_id)
}
</script>
\ No newline at end of file
......@@ -15,6 +15,7 @@
:item="item"
:key="item.id"
is-item
@delete="handleDeletedThread"
/>
</div>
</div>
......@@ -43,4 +44,8 @@ async function findCollectionData() {
}
await findCollectionData()
await $getCollection()
function handleDeletedThread (c_id) {
const findIndex = themesTagList.value.findIndex(i => i.c_id === c_id)
if (findIndex >= 0) themesTagList.value.splice(findIndex, 1)
}
</script>
\ No newline at end of file
......@@ -9,6 +9,7 @@
v-for="item in threads"
:item="item"
:key="item.c_id"
@delete="handleDeletedThread"
/>
</div>
</div>
......@@ -51,4 +52,9 @@ async function getThreadData() {
}
await getThreadData()
await $getCollection()
function handleDeletedThread (c_id) {
const findIndex = threads.value.findIndex(i => i.c_id === c_id)
if (findIndex >= 0) threads.value.splice(findIndex, 1)
}
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册