mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-11-13 22:11:42 +08:00
refactor: 重构插件可用性检测逻辑,统一传参和状态管理
1. 抽离统一的插件ID枚举NeedPluginIds,替换硬编码的插件ID字符串 2. 修改usePluginAvailable调用方式,改为对象传参模式 3. 统一插件不可用页面的提示文本和刷新逻辑,新增检测状态绑定 4. 优化uh-plugin-unavailable组件的兜底数据和样式
This commit is contained in:
@@ -16,13 +16,7 @@
|
||||
|
||||
/** 插件信息(未在清单中时兜底) */
|
||||
const pluginInfo = computed(() => {
|
||||
const info = NeedPlugins.get(props.pluginId)
|
||||
return info || {
|
||||
id: props.pluginId,
|
||||
name: props.name,
|
||||
desc: '',
|
||||
url: '',
|
||||
}
|
||||
return NeedPlugins.get(props.pluginId) ?? {pluginId:props.pluginId, name: '未找到插件' }
|
||||
})
|
||||
|
||||
function handleRefresh() {
|
||||
@@ -32,7 +26,7 @@
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view v-if="pluginInfo" class="mx-auto my-auto box-border flex flex-col items-center justify-center gap-6 text-sm">
|
||||
<view v-if="pluginInfo" class="max-w-3/5 mx-auto my-auto box-border flex flex-col items-center justify-center gap-6 text-sm">
|
||||
|
||||
<wd-icon class-prefix="uhemoji-icon" name="-cry" size="160rpx"></wd-icon>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user