♻️ 优化插件中心功能

This commit is contained in:
muwoo
2022-01-17 20:32:08 +08:00
parent 240175c571
commit 751c73b3a6
10 changed files with 48 additions and 21 deletions

View File

@@ -40,8 +40,11 @@
type="danger"
size="small"
shape="round"
:loading="pluginDetail.isloading"
@click="deletePlugin(pluginDetail)"
>移除</a-button
>
移除
</a-button
>
</div>
</div>
@@ -56,17 +59,11 @@
<div>{{ item.explain }}</div>
<a-tag
:key="cmd"
@click="
openPlugin({
cmd,
plugin: pluginDetail,
feature: item,
router: $router,
})
"
v-for="cmd in item.cmds"
@close="removeFeature(cmd)"
:color="!cmd.label && '#87d068'"
>
{{ cmd }}
{{ cmd.label || cmd }}
</a-tag>
</div>
</div>
@@ -101,6 +98,7 @@ const localPlugins = computed(() =>
)
);
const updateLocalPlugin = () => store.dispatch("updateLocalPlugin");
const startUnDownload = (name) => store.dispatch("startUnDownload", name);
const currentSelect = ref([0]);
@@ -124,6 +122,7 @@ const readme = computed(() => {
});
const deletePlugin = async (plugin) => {
startUnDownload(plugin.name);
await window.market.deletePlugin(plugin);
updateLocalPlugin();
};