mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
🐛 Fix nodes panel reactivity bug (#1972)
* add keys * fix nodes panel reactivity bug * fix lint issues
This commit is contained in:
parent
a74fc78ed3
commit
a842e4bc0a
|
@ -8,7 +8,7 @@
|
|||
@before-leave="beforeLeave"
|
||||
@leave="leave"
|
||||
>
|
||||
<div v-for="(item, index) in elements" :key="item.key" :class="item.type">
|
||||
<div v-for="(item, index) in elements" :key="item.key" :class="item.type" :data-key="item.key">
|
||||
<CreatorItem
|
||||
:item="item"
|
||||
:active="activeIndex === index && !disabled"
|
||||
|
|
|
@ -29,9 +29,17 @@ export default Vue.extend({
|
|||
props: [
|
||||
'active',
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
allNodeTypes: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
nodeTypes(): INodeTypeDescription[] {
|
||||
return this.$store.getters.allNodeTypes;
|
||||
},
|
||||
visibleNodeTypes(): INodeTypeDescription[] {
|
||||
return this.$store.getters.allNodeTypes
|
||||
return this.allNodeTypes
|
||||
.filter((nodeType: INodeTypeDescription) => {
|
||||
return !HIDDEN_NODES.includes(nodeType.name);
|
||||
});
|
||||
|
@ -73,6 +81,13 @@ export default Vue.extend({
|
|||
this.$emit('nodeTypeSelected', nodeTypeName);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
nodeTypes(newList, prevList) {
|
||||
if (prevList.length === 0) {
|
||||
this.allNodeTypes = newList;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue