🐛 修复复制文件bug

This commit is contained in:
muwoo 2022-01-13 12:04:53 +08:00
parent 8521262344
commit 6b96df3da5
4 changed files with 13 additions and 3 deletions

View File

@ -35,6 +35,8 @@ export default () => {
win.loadURL("app://./index.html");
}
win.webContents.openDevTools();
protocol.interceptFileProtocol("image", (req, callback) => {
const url = req.url.substr(8);
callback(decodeURI(url));

View File

@ -3,7 +3,8 @@
<div class="select-tag" v-show="currentPlugin.cmd">{{ currentPlugin.cmd }}</div>
<div :class="clipboardFile[0].name ? 'clipboard-tag' : 'clipboard-img'" v-if="!!clipboardFile.length">
<img :src="getIcon()" />
{{ clipboardFile[0].name }}
<div class="ellipse">{{ clipboardFile[0].name }}</div>
<a-tag color="#aaa" v-if="clipboardFile.length > 1">{{ clipboardFile.length }}</a-tag>
</div>
<a-input
id="search"
@ -197,6 +198,12 @@ const newWindow = () => {
left: 0;
width: 100%;
align-items: center;
.ellipse {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 200px;
}
.select-tag {
white-space: pre;
user-select: none;

View File

@ -1,5 +1,5 @@
import { createApp } from "vue";
import { Button, List, Spin, Input, Avatar } from "ant-design-vue";
import { Button, List, Spin, Input, Avatar, Tag } from "ant-design-vue";
import App from "./App.vue";
createApp(App)
@ -8,4 +8,5 @@ createApp(App)
.use(Spin)
.use(Input)
.use(Avatar)
.use(Tag)
.mount("#app");

View File

@ -120,8 +120,8 @@ export default ({
clearClipboardFile();
window.setSubInputValue({ value: contentText });
}
clipboard.clear();
}
clipboard.clear();
};
const clearClipboardFile = () => {