I have a table component that is rendered when a node on my diagram is selected. In my template for the component that is rendering the table I have this:
<div v-if="this.nodeName != ''" class="flex">
<table-details :title="tableName" :cardListData="valuesCardData"/>
</div>
the problem is once the name is clicked the nodeName is no longer an empty string so it wont render again with the new data. Here is how I am getting the name + the API call to back end.
data() {
return {
nodeName: '',
tableName: null,
}
}
getNodeClicked() {
window.addEventListener('sankey_node_clicked', (e) => { (this.nodeName = e.detail.name) })
},
async getTableData() {
const nodeData = this.dateRange
? await get('nodeData', {
dateStart: this.dateRange[0],
dateEnd: this.dateRange[1],
nodeName: this.nodeName
}) : await get('nodeData', {
nodeName: this.nodeName
});
console.log(nodeData)
this.valuesCardData.push(nodeData);
},
},