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

收藏夹

上级 6da38100
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
leading-icon="i-heroicons-plus-20-solid" leading-icon="i-heroicons-plus-20-solid"
label="创建新集合" label="创建新集合"
color="gray" color="gray"
@click="handleOpenCreate"
/> />
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<UButton color="white" size="md" class="flex"> <UButton color="white" size="md" class="flex">
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
</UModal> </UModal>
</template> </template>
<script setup> <script setup>
const Library = inject('Library')
const isOpenSelect = ref(false) const isOpenSelect = ref(false)
function handleClose () { function handleClose () {
isOpenSelect.value = false isOpenSelect.value = false
...@@ -44,4 +46,8 @@ function handleOpen (id) { ...@@ -44,4 +46,8 @@ function handleOpen (id) {
isOpenSelect.value = true isOpenSelect.value = true
} }
defineExpose({ handleOpen }) defineExpose({ handleOpen })
function handleOpenCreate () {
handleClose()
Library.handleOpenCreateLibrary()
}
</script> </script>
...@@ -60,9 +60,19 @@ const Library = inject('Library') ...@@ -60,9 +60,19 @@ const Library = inject('Library')
const textColor = 'text-gray-500 dark:text-gray-400' const textColor = 'text-gray-500 dark:text-gray-400'
const actionItems = [ const actionItems = [
[ [
{
label: '添加到收藏',
icon: 'i-heroicons-plus',
click: () => {
handleOpenSelect()
}
},
{ {
label: '更改集合', label: '更改集合',
icon: 'i-heroicons-squares-plus' icon: 'i-heroicons-squares-plus',
click: () => {
handleOpenSelect()
}
}, },
{ {
label: '从收藏中移除', label: '从收藏中移除',
......
...@@ -66,6 +66,7 @@ function handleOpenSelect (id) { ...@@ -66,6 +66,7 @@ function handleOpenSelect (id) {
refSelect.value.handleOpen(id) refSelect.value.handleOpen(id)
} }
provide('Library', { provide('Library', {
handleOpenSelect handleOpenSelect,
handleOpenCreateLibrary
}) })
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册