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

1

上级 c45aeb38
......@@ -52,7 +52,7 @@
</template>
<script setup>
const { $isLibraryCreateOpen } = storeToRefs(useLibraryStore())
const { $closeLibraryCreate } = useLibraryStore()
const { $closeLibraryCreate, $getCollection } = useLibraryStore()
const { setOrUpdateCollection } = useCollectionRequest()
const title = ref('')
const description = ref('')
......@@ -70,5 +70,6 @@ async function handleCreate () {
loading.value = false
if (error.value) return
$closeLibraryCreate()
$getCollection()
}
</script>
......@@ -50,7 +50,7 @@
</template>
<script setup>
const { $isLibrarySelectOpen, $selectCollectionId, $selectThreadId, $collection } = storeToRefs(useLibraryStore())
const { $openLibrarySelect, $closeLibrarySelect, $openLibraryCreate, $setSelectCollectionId, $getCollection } = useLibraryStore()
const { $closeLibrarySelect, $openLibraryCreate, $setSelectCollectionId, $getCollection } = useLibraryStore()
const { saveCollection, deleteCollectionRecord } = useCollectionRequest()
// 合集列表
const selected = ref([])
......@@ -58,9 +58,6 @@ const loading = ref(false)
function handleClose () {
$closeLibrarySelect()
}
function handleOpen (id) {
$openLibrarySelect()
}
function handleOpenCreate () {
handleClose()
$openLibraryCreate()
......@@ -85,9 +82,12 @@ async function handleSave() {
}
loading.value = false
handleClose()
$getCollection()
}
watch(() => $isLibrarySelectOpen.value, () => {
selected.value = [...$selectCollectionId.value]
if (!$collection.value.length) {
$getCollection()
}
})
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册