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

View File

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