diff --git a/src/renderer/App.vue b/src/renderer/App.vue index eb54438..117d0c6 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -162,6 +162,10 @@ export default { } }, changeCurrent(index) { + const webview = document.getElementById('webview'); + webview && webview.send('changeCurrent', index); + if (!this.options) return; + if (this.currentSelect + index > this.options.length - 1 || this.currentSelect + index < 0) return; this.currentSelect = this.currentSelect + index; }, diff --git a/src/renderer/pages/plugins/index.vue b/src/renderer/pages/plugins/index.vue index 5438094..625b8c3 100644 --- a/src/renderer/pages/plugins/index.vue +++ b/src/renderer/pages/plugins/index.vue @@ -24,7 +24,7 @@ export default { webview: null, query: this.$route.query, config: {}, - templatePath: `File://${path.join(__static, './plugins/doc/doc-tpl.html')}?code=${JSON.parse(this.$route.query.detail).code}&targetFile=${encodeURIComponent(this.$route.query.sourceFile)}`, + templatePath: `File://${path.join(__static, './plugins/tpl/index.html')}?code=${JSON.parse(this.$route.query.detail).code}&targetFile=${encodeURIComponent(this.$route.query.sourceFile)}&preloadPath=${this.$route.query.preload}`, } }, mounted() { @@ -75,7 +75,6 @@ export default { }, beforeRouteUpdate() { this.path = `File://${this.$route.query.sourceFile}`; - console.log(this.pluginInfo) this.webview.send('onPluginEnter', this.pluginInfo); }, beforeDestroy() { diff --git a/src/renderer/pages/search/subpages/plugin.vue b/src/renderer/pages/search/subpages/plugin.vue index 06df3be..f6d14aa 100644 --- a/src/renderer/pages/search/subpages/plugin.vue +++ b/src/renderer/pages/search/subpages/plugin.vue @@ -72,7 +72,7 @@ export default { computed: { ...mapState('main', ['devPlugins']), pluginDetail() { - return this.devPlugins[this.currentSelect] + return this.prodPlugin[this.currentSelect] }, prodPlugin() { return this.devPlugins.filter(plugin => plugin.type === 'prod') diff --git a/src/renderer/store/modules/main.js b/src/renderer/store/modules/main.js index 203ace7..09d4998 100644 --- a/src/renderer/store/modules/main.js +++ b/src/renderer/store/modules/main.js @@ -230,7 +230,13 @@ const actions = { id: uuidv4(), sourceFile: `${fileUrl}/${config.main}`, type: 'prod', - icon: payload.logo + icon: payload.logo, + subType: (() => { + if (config.main) { + return '' + } + return 'template'; + })() }; commit('commonUpdate', { devPlugins: [pluginConfig, ...state.devPlugins], diff --git a/static/plugins/doc/doc.js b/static/plugins/tpl/doc.js similarity index 100% rename from static/plugins/doc/doc.js rename to static/plugins/tpl/doc.js diff --git a/static/plugins/doc/doc-tpl.html b/static/plugins/tpl/index.html similarity index 54% rename from static/plugins/doc/doc-tpl.html rename to static/plugins/tpl/index.html index 12dce7a..379984e 100644 --- a/static/plugins/doc/doc-tpl.html +++ b/static/plugins/tpl/index.html @@ -4,8 +4,8 @@