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

收藏夹

上级 244f324a
...@@ -40,7 +40,8 @@ const isOpenSelect = ref(false) ...@@ -40,7 +40,8 @@ const isOpenSelect = ref(false)
function handleClose () { function handleClose () {
isOpenSelect.value = false isOpenSelect.value = false
} }
function handleOpen () { function handleOpen (id) {
isOpenSelect.value = true isOpenSelect.value = true
} }
defineExpose({ handleOpen })
</script> </script>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
variant="ghost" variant="ghost"
size="2xs" size="2xs"
icon="i-heroicons-plus" icon="i-heroicons-plus"
@click="handleOpenSelect"
/> />
</UTooltip> </UTooltip>
<UDropdown class="flex flex-grow" :items="actionItems"> <UDropdown class="flex flex-grow" :items="actionItems">
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
<UDivider /> <UDivider />
</template> </template>
<script setup> <script setup>
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 = [
[ [
...@@ -72,4 +74,7 @@ const actionItems = [ ...@@ -72,4 +74,7 @@ const actionItems = [
} }
] ]
] ]
function handleOpenSelect (id) {
Library.handleOpenSelect(id)
}
</script> </script>
\ No newline at end of file
...@@ -58,8 +58,14 @@ ...@@ -58,8 +58,14 @@
<script setup> <script setup>
const searchQuery = ref('') const searchQuery = ref('')
const refCreate = ref(null) const refCreate = ref(null)
const refSelect = ref(null)
function handleOpenCreateLibrary () { function handleOpenCreateLibrary () {
refCreate.value.handleOpen() refCreate.value.handleOpen()
} }
const refSelect = ref(null)
function handleOpenSelect (id) {
refSelect.value.handleOpen(id)
}
provide('Library', {
handleOpenSelect
})
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册