mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-26 12:42:34 +08:00
chore: API改为类,成员函数变量增加static关键字 & yarn lint
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
<template>
|
||||
<div v-show="!!options.length && (searchValue || !!clipboardFile.length) && !currentPlugin.name" class="options" ref="scrollDom">
|
||||
<div
|
||||
v-show="
|
||||
!!options.length &&
|
||||
(searchValue || !!clipboardFile.length) &&
|
||||
!currentPlugin.name
|
||||
"
|
||||
class="options"
|
||||
ref="scrollDom"
|
||||
>
|
||||
<a-list item-layout="horizontal" :dataSource="sort(options)">
|
||||
<template #renderItem="{ item, index }">
|
||||
<a-list-item
|
||||
@@ -11,10 +19,7 @@
|
||||
<span v-html="renderTitle(item.name)"></span>
|
||||
</template>
|
||||
<template #avatar>
|
||||
<a-avatar
|
||||
style="border-radius: 0"
|
||||
:src="item.icon"
|
||||
/>
|
||||
<a-avatar style="border-radius: 0" :src="item.icon" />
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
@@ -62,7 +67,10 @@ const renderTitle = (title) => {
|
||||
|
||||
const renderDesc = (desc) => {
|
||||
if (desc.length > 80) {
|
||||
return `${desc.substr(0, 63)}...${desc.substr(desc.length - 14, desc.length)}`
|
||||
return `${desc.substr(0, 63)}...${desc.substr(
|
||||
desc.length - 14,
|
||||
desc.length
|
||||
)}`;
|
||||
}
|
||||
return desc;
|
||||
};
|
||||
@@ -79,7 +87,6 @@ const sort = (options) => {
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<template>
|
||||
<div class="rubick-select">
|
||||
<div class="select-tag" v-show="currentPlugin.cmd">{{ currentPlugin.cmd }}</div>
|
||||
<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()" />
|
||||
<div class="ellipse">{{ clipboardFile[0].name }}</div>
|
||||
<a-tag color="#aaa" v-if="clipboardFile.length > 1">{{ clipboardFile.length }}</a-tag>
|
||||
<a-tag color="#aaa" v-if="clipboardFile.length > 1">{{
|
||||
clipboardFile.length
|
||||
}}</a-tag>
|
||||
</div>
|
||||
<a-input
|
||||
id="search"
|
||||
@@ -15,7 +19,7 @@
|
||||
@input="(e) => changeValue(e)"
|
||||
@keydown.down="(e) => keydownEvent(e, 'down')"
|
||||
@keydown.up="(e) => keydownEvent(e, 'up')"
|
||||
@keydown="e => checkNeedInit(e)"
|
||||
@keydown="(e) => checkNeedInit(e)"
|
||||
:value="searchValue"
|
||||
:placeholder="placeholder || 'Hi, Rubick2'"
|
||||
@keypress.enter="(e) => keydownEvent(e, 'enter')"
|
||||
@@ -25,7 +29,10 @@
|
||||
<template #suffix>
|
||||
<div class="suffix-tool">
|
||||
<MoreOutlined @click="showSeparate()" class="icon-more" />
|
||||
<div v-if="currentPlugin && currentPlugin.logo" style="position: relative">
|
||||
<div
|
||||
v-if="currentPlugin && currentPlugin.logo"
|
||||
style="position: relative"
|
||||
>
|
||||
<a-spin v-show="pluginLoading" class="loading">
|
||||
<template #indicator>
|
||||
<LoadingOutlined style="font-size: 42px" />
|
||||
@@ -96,7 +103,7 @@ const keydownEvent = (e, key: string) => {
|
||||
modifiers,
|
||||
},
|
||||
});
|
||||
const runPluginDisable = e.target.value === "" || props.currentPlugin.name
|
||||
const runPluginDisable = e.target.value === "" || props.currentPlugin.name;
|
||||
switch (key) {
|
||||
case "up":
|
||||
emit("changeCurrent", -1);
|
||||
@@ -192,7 +199,9 @@ const changeHideOnBlur = () => {
|
||||
|
||||
const getIcon = () => {
|
||||
if (props.clipboardFile[0].dataUrl) return props.clipboardFile[0].dataUrl;
|
||||
return props.clipboardFile[0].isFile ? require("../assets/file.png") : require("../assets/folder.png")
|
||||
return props.clipboardFile[0].isFile
|
||||
? require("../assets/file.png")
|
||||
: require("../assets/folder.png");
|
||||
};
|
||||
|
||||
const newWindow = () => {
|
||||
|
||||
Reference in New Issue
Block a user