Skip to main content
Topic: How to use {{ActiveUser}} inside `v-if` ? (Read 875 times) previous topic - next topic

How to use {{ActiveUser}} inside `v-if` ?

Hello guys, basically what I'm trying to do is to match the current logged in user to an ID, if it matches, then render the div.. otherwise do nothing... but everytime I try to use VueJs `v-if` attribute It doesn't do anything.. also if I try to use {{ActiveUser.id}} inside a div as an id attribute field, or classname or whtever... it makes it a string... e.g. `div id={{ActiveUser.id}}` => `div id="{{ActiveUser.id}}"`

Re: How to use {{ActiveUser}} inside `v-if` ?

Reply #1
Please use attribute databind for vuejs
<div :id="ActiveUser.id">...</div>

Regards

Re: How to use {{ActiveUser}} inside `v-if` ?

Reply #2
Please use attribute databind for vuejs
<div :id="ActiveUser.id">...</div>

Regards


Awesome! thanks for pointing me to the correct direction :D
Now, how I would go around making the `v-if` attribute work with ActiveUser?