mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Speed up expression editor
This commit is contained in:
parent
a5300a5f24
commit
2d9c2e1a1e
|
@ -30,7 +30,7 @@
|
||||||
<div class="editor-description">
|
<div class="editor-description">
|
||||||
Result
|
Result
|
||||||
</div>
|
</div>
|
||||||
<expression-input :parameter="parameter" resolvedValue="true" ref="expressionResult" rows="8" :value="value" :path="path"></expression-input>
|
<expression-input :parameter="parameter" resolvedValue="true" ref="expressionResult" rows="8" :value="displayValue" :path="path"></expression-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -41,22 +41,20 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
|
||||||
|
|
||||||
import ExpressionInput from '@/components/ExpressionInput.vue';
|
import ExpressionInput from '@/components/ExpressionInput.vue';
|
||||||
import VariableSelector from '@/components/VariableSelector.vue';
|
import VariableSelector from '@/components/VariableSelector.vue';
|
||||||
|
|
||||||
import { IVariableItemSelected } from '@/Interface';
|
import { IVariableItemSelected } from '@/Interface';
|
||||||
|
|
||||||
import {
|
|
||||||
Workflow,
|
|
||||||
} from 'n8n-workflow';
|
|
||||||
|
|
||||||
import { externalHooks } from '@/components/mixins/externalHooks';
|
import { externalHooks } from '@/components/mixins/externalHooks';
|
||||||
|
import { genericHelpers } from '@/components/mixins/genericHelpers';
|
||||||
|
|
||||||
import mixins from 'vue-typed-mixins';
|
import mixins from 'vue-typed-mixins';
|
||||||
|
|
||||||
export default mixins(externalHooks).extend({
|
export default mixins(
|
||||||
|
externalHooks,
|
||||||
|
genericHelpers,
|
||||||
|
).extend({
|
||||||
name: 'ExpressionEdit',
|
name: 'ExpressionEdit',
|
||||||
props: [
|
props: [
|
||||||
'dialogVisible',
|
'dialogVisible',
|
||||||
|
@ -70,16 +68,28 @@ export default mixins(externalHooks).extend({
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
displayValue: '',
|
||||||
|
latestValue: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.displayValue = this.value;
|
||||||
|
this.latestValue = this.value;
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
valueChanged (value: string) {
|
valueChanged (value: string) {
|
||||||
this.$emit('valueChanged', value);
|
this.latestValue = value;
|
||||||
|
this.callDebounced('updateDisplayValue', 500);
|
||||||
|
},
|
||||||
|
|
||||||
|
updateDisplayValue () {
|
||||||
|
this.displayValue = this.latestValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
closeDialog () {
|
closeDialog () {
|
||||||
// Handle the close externally as the visible parameter is an external prop
|
// Handle the close externally as the visible parameter is an external prop
|
||||||
// and is so not allowed to be changed here.
|
// and is so not allowed to be changed here.
|
||||||
|
this.$emit('valueChanged', this.latestValue);
|
||||||
this.$emit('closeDialog');
|
this.$emit('closeDialog');
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue