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

收藏夹

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