As a newcomer to the Vue framework, I find myself immersed in a project focused on creating and editing directed graphs online. One particular challenge I am facing is ensuring that components can react differently based on the application's current state.
Take, for example, a graph node: in edit mode, you may want to select the node by clicking on it, but in delete mode, clicking should result in the node disappearing. Additionally, there are various buttons responsible for switching between these states.
So, my question is: how can I elegantly and concisely address this issue in a declarative, Vue-style manner? It would be even better if any solutions could integrate with D3.js, which is also used in my project.