mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
优化文件夹内插件的显示顺序,确保按照保存顺序排列插件,提升用户体验。
This commit is contained in:
@@ -186,10 +186,20 @@ const displayedPlugins = computed(() => {
|
|||||||
})
|
})
|
||||||
return filteredDataList.value.filter(plugin => !folderedPluginIds.has(plugin.id))
|
return filteredDataList.value.filter(plugin => !folderedPluginIds.has(plugin.id))
|
||||||
} else {
|
} else {
|
||||||
// 文件夹内:只显示文件夹中的插件
|
// 文件夹内:按照文件夹内保存的顺序显示插件
|
||||||
const folderData = pluginFolders.value[currentFolder.value]
|
const folderData = pluginFolders.value[currentFolder.value]
|
||||||
const folderPluginIds = Array.isArray(folderData) ? folderData : folderData?.plugins || []
|
const folderPluginIds = Array.isArray(folderData) ? folderData : folderData?.plugins || []
|
||||||
return filteredDataList.value.filter(plugin => folderPluginIds.includes(plugin.id))
|
|
||||||
|
// 按照文件夹内的顺序排列插件
|
||||||
|
const orderedPlugins: Plugin[] = []
|
||||||
|
folderPluginIds.forEach((pluginId: string) => {
|
||||||
|
const plugin = filteredDataList.value.find(p => p.id === pluginId)
|
||||||
|
if (plugin) {
|
||||||
|
orderedPlugins.push(plugin)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return orderedPlugins
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user