feat: 支持从右侧operate进入全部数据侧栏

This commit is contained in:
ZiuChen 2022-09-04 14:21:23 +08:00
parent 11a3bc9f0d
commit 8a783dc7b9
2 changed files with 10 additions and 2 deletions

View File

@ -50,7 +50,11 @@
<div class="clip-operate" v-show="activeIndex === index">
<template v-for="{ id, title } of operation">
<div
v-if="id !== 'collect' || (id === 'collect' && item.collect !== true)"
v-if="
(id !== 'collect' && id !== 'view') ||
(id === 'collect' && item.collect !== true) ||
(id === 'view' && item.type !== 'image')
"
:class="id"
:title="title"
@click.stop="handleOperateClick({ id, item })"
@ -97,6 +101,7 @@ const activeIndex = ref(0)
const handleMouseOver = (index) => (activeIndex.value = index)
const operation = [
{ id: 'copy', title: '复制' },
{ id: 'view', title: '查看全部' },
{ id: 'collect', title: '收藏' },
{ id: 'remove', title: '删除' }
]
@ -105,6 +110,9 @@ const handleOperateClick = ({ id, item }) => {
case 'copy':
window.copy(item)
break
case 'view':
emit('onDataChange', item)
break
case 'collect':
item.collect = true // important
window.db.updateDataBaseLocal(db)

View File

@ -79,7 +79,7 @@
display: flex;
align-items: center;
justify-content: center;
min-width: 100px;
min-width: 150px;
padding: 10px;
& * {
display: flex;