diff --git a/client/src/components/Editor/AsideDataSource.vue b/client/src/components/Editor/AsideDataSource.vue index 40706ae2..dfea7b54 100644 --- a/client/src/components/Editor/AsideDataSource.vue +++ b/client/src/components/Editor/AsideDataSource.vue @@ -57,7 +57,7 @@ diff --git a/client/src/components/Editor/AsideEnvVariable.vue b/client/src/components/Editor/AsideEnvVariable.vue index f979d86b..248033aa 100644 --- a/client/src/components/Editor/AsideEnvVariable.vue +++ b/client/src/components/Editor/AsideEnvVariable.vue @@ -43,7 +43,7 @@ diff --git a/client/src/components/Editor/AsideScript.vue b/client/src/components/Editor/AsideScript.vue index 9fbc9b55..a030e9c7 100644 --- a/client/src/components/Editor/AsideScript.vue +++ b/client/src/components/Editor/AsideScript.vue @@ -362,11 +362,15 @@ export default { this.defaultExpandedNodeKeys = Object.keys(this.expandedNodeMap); setImmediate(() => { + if (!this.$refs.tree) return; + // 自动选中 this.$refs.tree.setCurrentKey(this.$store.state.asideScript_currentNodeKey || null); }); setTimeout(() => { + if (!this.$refs.tree) return; + // 滚动到目标位置 let entryId = this.$refs.tree.getCurrentKey(); if (entryId) { diff --git a/client/src/const.js b/client/src/const.js index c3988cfc..c12d97b6 100644 --- a/client/src/const.js +++ b/client/src/const.js @@ -90,7 +90,7 @@ export const DATE_SOURCE = [ logo : logo_redis, tagType : 'danger', debugSupported: true, - sampleCode : `helper = DFF.SRC('{0}')\ndb_res = helper.query('GET', '"some_key"')`, + sampleCode : `helper = DFF.SRC('{0}')\ndb_res = helper.query('GET', 'some_key')`, configFields: { host : { default: null, isRequired: true }, port : { default: 6379 }, @@ -105,7 +105,7 @@ export const DATE_SOURCE = [ logo : logo_memcached, tagType : 'success', debugSupported: true, - sampleCode : `helper = DFF.SRC('{0}')\ndb_res = helper.query('GET', '"some_key"')`, + sampleCode : `helper = DFF.SRC('{0}')\ndb_res = helper.query('GET', 'some_key')`, configFields: { servers: { default: null, isRequired: true }, },