mirror of
https://github.com/rubickCenter/rubick
synced 2026-03-07 06:20:41 +08:00
✨ 支持ui插件下载&运行
This commit is contained in:
@@ -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>
|
||||
|
||||
2
runner/src/shims-vue.d.ts
vendored
2
runner/src/shims-vue.d.ts
vendored
@@ -4,3 +4,5 @@ declare module '*.vue' {
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
||||
declare const __static: string
|
||||
|
||||
Reference in New Issue
Block a user