Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

74
Views
Vue template with v-if condition does not react on value change

I have a template with v-if condition base on the data value. But if I change the value it does not redrav the template. I see the value ich changed in Vue debugger but v-if blocks it like it was empty like on component load.

Here is the code:

<div v-if="newSelectedDevices" class="mt-2 mb-2">
    <template>
        <b-field class="has-horizontal-line pb-2">
            <b-taglist>
                <b-tag  v-for="(included, index) in newSelectedDevices"
                        :key="'included_' + index"
                          // This is the problem. It set is-hidden although isNew value is true
                        :class="{'is-hidden': included.isNew, 'taglist': true, 'is-danger': true}"
                        closable
                        @close="removeFromNewSelected(index)"
                >
                    {{ included.name }}
                </b-tag>
            </b-taglist>
        </b-field>
    </template>
</div>

enter image description here

What is wrong with this code? Thanks for any help.

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs