feat: 添加插件优先级
This commit is contained in:
1 parent
e155524e3e
commit
37791ab04e
6 files changed
+25
-8
No files matched your search
@@ -197,7 +197,7 @@ onBeforeUnmount(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
transition: background-color 0.3s ease;
|
||||
|
||||
overflow-x: hidden;
|
||||
.item-main-front {
|
||||
height: 100%;
|
||||
min-width: 10px;
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
<miao-lazy-div
|
||||
v-for="dir in showData_directory"
|
||||
:key="dir.id"
|
||||
min-height="50px">
|
||||
min-height="50px"
|
||||
margin="10px">
|
||||
<miaoDirectoryItem
|
||||
:item="dir"
|
||||
:color="props.color"
|
||||
|
||||
@@ -376,7 +376,12 @@ const handleItemClick = (item: VirtualDirectory | VirtualFile) => {
|
||||
handleItemSelect(item)
|
||||
} else {
|
||||
if (item.type === 'file') {
|
||||
openUrl(`${baseUrl}${api.get}${item.path}`)
|
||||
const useablePlugins = pluginCenter.getUsablePlugin([], [item])
|
||||
if(useablePlugins.length > 0){
|
||||
pluginCenter.usePlugin(useablePlugins[0].key, [], [item])
|
||||
} else {
|
||||
openUrl(`${baseUrl}${api.get}${item.path}`)
|
||||
}
|
||||
} else if (item.type === 'directory') {
|
||||
setCurrentDirectory(item)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ const pluginConfig: registerComponentOption = {
|
||||
return vFiles[0].name.endsWith('?')
|
||||
},
|
||||
disable: false,
|
||||
single: true
|
||||
single: true,
|
||||
priority: 5,
|
||||
}
|
||||
|
||||
export default pluginConfig
|
||||
|
||||
Reference in new issue
Block a user