mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-07 22:04:06 +08:00
feat: 添加卡片组件 重要版本更新将弹出提示更新内容
This commit is contained in:
parent
fde3286e82
commit
d2b64d890a
59
src/cpns/ClipCard.vue
Normal file
59
src/cpns/ClipCard.vue
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div class="clip-card" v-show="isShow">
|
||||||
|
<div class="clip-card-header">
|
||||||
|
<slot name="header">
|
||||||
|
<div class="clip-card-header-title">
|
||||||
|
{{ title }}
|
||||||
|
</div>
|
||||||
|
<div class="clip-card-header-operate">
|
||||||
|
<span class="clip-card-header-operate-btn" @click="handleCloseBtnClick">❌</span>
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
|
<div class="clip-card-content">
|
||||||
|
<slot>
|
||||||
|
<template v-for="c of content.split('\n')">
|
||||||
|
<div class="clip-card-content-item">
|
||||||
|
{{ c }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
|
<div class="clip-card-footer"><slot name="footer"></slot></div>
|
||||||
|
</div>
|
||||||
|
<div class="clip-overlay" v-show="isShow"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const emit = defineEmits(['onClose'])
|
||||||
|
const props = defineProps({
|
||||||
|
isShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
version: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const handleCloseBtnClick = () => {
|
||||||
|
utools.dbStorage.setItem('notify', {
|
||||||
|
title: props.title,
|
||||||
|
content: props.content,
|
||||||
|
version: props.version
|
||||||
|
})
|
||||||
|
emit('onClose')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@import '../style';
|
||||||
|
</style>
|
5
src/data/notify.json
Normal file
5
src/data/notify.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "重要版本更新提示",
|
||||||
|
"content": "1. 如果你是第一次使用此插件, 请务必设置跟随主程序启动选项, 否则可能导致剪贴板记录丢失\n2. 插件内的收藏栏将在最近一个版本中移除, 届时点击收藏按钮将跳转到备忘快贴, 请尽快将已有数据保存, 使用备忘快贴代替\n3. 插件使用过程中遇到任何问题, 请到论坛发布页回帖或加入QQ群反馈",
|
||||||
|
"version": 1
|
||||||
|
}
|
81
src/style/cpns/clip-card.less
Normal file
81
src/style/cpns/clip-card.less
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
.clip-card {
|
||||||
|
position: absolute;
|
||||||
|
top: 10%;
|
||||||
|
left: 10%;
|
||||||
|
width: 80%;
|
||||||
|
height: 80%;
|
||||||
|
z-index: 999999999;
|
||||||
|
background-color: @bg-color;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
|
||||||
|
&-header {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 5px 5px 0px 0px;
|
||||||
|
background-color: @primary-color;
|
||||||
|
color: @bg-color;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
.clip-card-header-title {
|
||||||
|
margin-left: 25px;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.clip-card-header-operate {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 20px;
|
||||||
|
.clip-card-header-operate-item {
|
||||||
|
margin-left: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-content {
|
||||||
|
position: absolute;
|
||||||
|
top: 50px;
|
||||||
|
left: 0;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 30px;
|
||||||
|
color: @text-color;
|
||||||
|
.clip-card-content-item {
|
||||||
|
font-size: 15px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
background-color: @primary-color;
|
||||||
|
color: @text-color;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-radius: 0px 0px 5px 5px;
|
||||||
|
.clip-card-footer-operate {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.clip-card-footer-operate-item {
|
||||||
|
margin-left: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -53,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.clip-overlay {
|
.clip-overlay {
|
||||||
z-index: 999999999;
|
z-index: 9999999;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
.import() {
|
.import() {
|
||||||
/* 导入全部涉及到变量的样式文件 */
|
/* 导入全部涉及到变量的样式文件 */
|
||||||
|
@import (multiple) './cpns/clip-card.less';
|
||||||
@import (multiple) './cpns/clip-float-btn.less';
|
@import (multiple) './cpns/clip-float-btn.less';
|
||||||
@import (multiple) './cpns/clip-full-data.less';
|
@import (multiple) './cpns/clip-full-data.less';
|
||||||
@import (multiple) './cpns/clip-item-list.less';
|
@import (multiple) './cpns/clip-item-list.less';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
<ClipCard :isShow="notifyShown" v-bind="notify" @onClose="notifyShown = false"></ClipCard>
|
||||||
<ClipFloatBtn :icon="'🧭'" @onBtnClick="restoreDataBase"></ClipFloatBtn>
|
<ClipFloatBtn :icon="'🧭'" @onBtnClick="restoreDataBase"></ClipFloatBtn>
|
||||||
<ClipFullData
|
<ClipFullData
|
||||||
:isShow="fullDataShow"
|
:isShow="fullDataShow"
|
||||||
@ -56,11 +57,17 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, onMounted, computed, nextTick } from 'vue'
|
import { ref, watch, onMounted, computed, nextTick } from 'vue'
|
||||||
|
import ClipCard from '../cpns/ClipCard.vue'
|
||||||
import ClipItemList from '../cpns/ClipItemList.vue'
|
import ClipItemList from '../cpns/ClipItemList.vue'
|
||||||
import ClipFullData from '../cpns/ClipFullData.vue'
|
import ClipFullData from '../cpns/ClipFullData.vue'
|
||||||
import ClipSearch from '../cpns/ClipSearch.vue'
|
import ClipSearch from '../cpns/ClipSearch.vue'
|
||||||
import ClipSwitch from '../cpns/ClipSwitch.vue'
|
import ClipSwitch from '../cpns/ClipSwitch.vue'
|
||||||
import ClipFloatBtn from '../cpns/ClipFloatBtn.vue'
|
import ClipFloatBtn from '../cpns/ClipFloatBtn.vue'
|
||||||
|
import notify from '../data/notify.json'
|
||||||
|
|
||||||
|
const notifyShown = ref(false)
|
||||||
|
const storageNotify = utools.dbStorage.getItem('notify')
|
||||||
|
notifyShown.value = storageNotify ? storageNotify.version < notify.version : true
|
||||||
|
|
||||||
const isMultiple = ref(false)
|
const isMultiple = ref(false)
|
||||||
|
|
||||||
|
28
src/views/Notify.vue
Normal file
28
src/views/Notify.vue
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<template>
|
||||||
|
<div class="notify">
|
||||||
|
<ClipCard>
|
||||||
|
<template #header>
|
||||||
|
<div class="notify-header">
|
||||||
|
<div class="notify-header-title">通知</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="notify-content">
|
||||||
|
<div class="notify-content-title">通知标题</div>
|
||||||
|
<div class="notify-content-text">通知内容</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="notify-footer">
|
||||||
|
<div class="notify-footer-btn">知道了</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ClipCard>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import ClipCard from '../cpns/ClipCard.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@import '../style';
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user