mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-08 03:24:12 +08:00
✨ 支持 template 模板 list 模式
This commit is contained in:
parent
8bcc5d409c
commit
ef33ff0a3d
@ -32,4 +32,11 @@ export default {
|
||||
const res = await axios.get(url);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async getSearchDetail(url: string) {
|
||||
const res = await axios.get(
|
||||
"https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/search.json"
|
||||
);
|
||||
return res.data;
|
||||
},
|
||||
};
|
||||
|
@ -1,13 +1,49 @@
|
||||
<template>
|
||||
|
||||
<div class="tools">
|
||||
<PluginList
|
||||
v-if="tools && !!tools.length"
|
||||
@downloadSuccess="downloadSuccess"
|
||||
title="搜索工具"
|
||||
:list="tools"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "tools"
|
||||
};
|
||||
<script setup>
|
||||
import { ref, computed, onBeforeMount } from "vue";
|
||||
import request from "../../../assets/request/index";
|
||||
import PluginList from "./plugin-list.vue";
|
||||
|
||||
import { useStore } from "vuex";
|
||||
const store = useStore();
|
||||
const totalPlugins = computed(() => store.state.totalPlugins);
|
||||
|
||||
const data = ref([]);
|
||||
|
||||
onBeforeMount(async () => {
|
||||
data.value = await request.getSearchDetail();
|
||||
});
|
||||
|
||||
const tools = computed(() => {
|
||||
const defaultData = data.value || [];
|
||||
if (!defaultData.length) return [];
|
||||
return defaultData.map((plugin) => {
|
||||
let searchInfo = null;
|
||||
totalPlugins.value.forEach((t) => {
|
||||
if (t.name === plugin) {
|
||||
searchInfo = t;
|
||||
}
|
||||
});
|
||||
return searchInfo;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
<style lang="less">
|
||||
.worker {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow-x: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
@ -69,11 +69,13 @@ import { useStore } from "vuex";
|
||||
import Finder from "./components/finder.vue";
|
||||
import System from "./components/system.vue";
|
||||
import Worker from "./components/worker.vue";
|
||||
import Tools from "./components/tools.vue";
|
||||
|
||||
const Components = {
|
||||
finder: Finder,
|
||||
system: System,
|
||||
worker: Worker,
|
||||
tools: Tools,
|
||||
};
|
||||
|
||||
const state = reactive({
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/app.972d60c9.css" rel="preload" as="style"><link href="js/app.81d45831.js" rel="preload" as="script"><link href="js/chunk-vendors.ebb3d342.js" rel="preload" as="script"><link href="css/app.972d60c9.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.ebb3d342.js"></script><script src="js/app.81d45831.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/app.12c0e429.css" rel="preload" as="style"><link href="js/app.d3f7d066.js" rel="preload" as="script"><link href="js/chunk-vendors.ebb3d342.js" rel="preload" as="script"><link href="css/app.12c0e429.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.ebb3d342.js"></script><script src="js/app.d3f7d066.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/feature/js/app.d3f7d066.js
Normal file
2
public/feature/js/app.d3f7d066.js
Normal file
File diff suppressed because one or more lines are too long
1
public/feature/js/app.d3f7d066.js.map
Normal file
1
public/feature/js/app.d3f7d066.js.map
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user