I am trying to create a condition where a property is checked against the ID of a div container. If they match, I want to display the container.
For example, in the code snippet below, I need to compare the activeWindow
property with the div id. If they are the same, I want to show the corresponding container.
I attempted to include the id
in the if statement, but it was unsuccessful.
When I directly input the string into the if statement like this:
v-if="activeWindow === activeWindow"
it works, but then the ID is hardcoded at two different places and not dynamic.
private activeWindow = 'activeWindow';
<div v-if="activeWindow === id" id="activeWindow">
<h1>This window is active</h1>
</div>
<div v-if="activeWindow === id" id="activeWindow1">
<h1>This window is active</h1>
</div>
Any suggestions on how to resolve this issue?