1

I got value from json in table, and I need if else statement. If value == enabled - some code.. else - some code.

example:

<md-table-cell>
  <span v-if="{{row.status}} == 'enabled'">
    <span>ENABLED<md-icon class="md-raised">check_circle</md-icon></span>
  </span>
  <span v-else>
    <span>DISABLED <md-icon class="md-raised">cancel</md-icon></span>
  </span>
</md-table-cell>

So, I need something like that. Any suggestions?

1
  • It should be v-if="row.status == 'enabled'" Commented Dec 12, 2016 at 13:32

1 Answer 1

3

Your code is wrong - you are using mustaches into the v-if which is not allowed and your code is suposed to not work, because think about v-if as vanilla javascript where mustaches doesn't work.

<span v-if="row.status == 'enabled'">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.