mirror of
https://github.com/rubickCenter/rubick
synced 2026-03-10 07:52:18 +08:00
feat: 支持 uTools list 模板
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user