支持ui插件下载&运行

This commit is contained in:
muwoo
2021-12-02 17:55:45 +08:00
parent c2f43bea39
commit 0132a11d7e
32 changed files with 951 additions and 244 deletions

View File

@@ -1,18 +1,19 @@
<template>
<webview
v-if="preload"
id="webview"
:src="`File://${pluginInfo.indexPath}`"
:preload="preload"
/>
</template>
<script setup lang="ts">
<script setup >
import { reactive, toRefs, onMounted } from "vue";
const state = reactive({
pluginInfo: {},
});
window.setPluginInfo = (pluginInfo: any) => {
window.setPluginInfo = (pluginInfo) => {
console.log(pluginInfo);
try {
state.pluginInfo = pluginInfo;
@@ -21,14 +22,7 @@ window.setPluginInfo = (pluginInfo: any) => {
}
};
onMounted(() => {
const webview: any = document.querySelector("webview");
webview.addEventListener("dom-ready", () => {
webview.openDevTools();
});
});
const { pluginInfo } = toRefs(state);
const { pluginInfo, preload } = toRefs(state);
</script>
<style>

View File

@@ -4,3 +4,5 @@ declare module '*.vue' {
const component: DefineComponent<{}, {}, any>
export default component
}
declare const __static: string