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

222

上级 5151fe09
...@@ -9,30 +9,48 @@ ...@@ -9,30 +9,48 @@
</UDropdown> </UDropdown>
</template> </template>
<script setup> <script setup>
const actionItems = [ const { $openLibrarySelect } = useLibraryStore()
[ const props = defineProps({
{ collection_id: {
label: '添加到收藏', type: [String, Number],
icon: 'i-heroicons-plus', default: ''
click: () => {
handleOpenSelect()
}
}, },
c_id: {
type: [String, Number],
default: ''
}
})
const actionItems = computed(() => {
let items
if (props.collection_id && props.c_id) {
items = [
{ {
label: '更改合集', label: '更改合集',
icon: 'i-heroicons-squares-plus', icon: 'i-heroicons-squares-plus',
click: () => { click: () => {
handleOpenSelect()
} }
}, },
{ {
label: '从收藏中移除', label: '从收藏中移除',
icon: 'i-heroicons-x-mark' icon: 'i-heroicons-x-mark'
}, }
]
} else {
items = [
{ {
label: '删除主题', label: '添加到收藏',
icon: 'i-heroicons-trash' icon: 'i-heroicons-plus',
click: () => {
$openLibrarySelect(props.c_id)
}
} }
] ]
] }
items.push({
label: '删除主题',
icon: 'i-heroicons-trash'
})
return [items]
})
</script> </script>
...@@ -35,7 +35,10 @@ ...@@ -35,7 +35,10 @@
@click="handleOpenSelect" @click="handleOpenSelect"
/> />
</UTooltip> </UTooltip>
<IActionThread /> <IActionThread
:collection_id="thread.collections.length ? thread.collections[0].collection_id : ''"
:c_id="item.c_id"
/>
</div> </div>
</div> </div>
<UDivider /> <UDivider />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册