nodegui/vue-nodegui

Are v-if and v-for working?

Closed this issue · 1 comments

mpuz commented

Are there reactive elements? This code produce nothing (console shows when variable changes) -

<vn-view v-if="serviceMap.size">
      <vn-button v-for="service in serviceMap" v-bind:key="service.key">{{
        service.value.name
      }}</vn-button>
    </vn-view>
mpuz commented

My bad, I have tried to iterate over Map and did not make it reactive using ref. The correct way is this

<div v-for="[fooKey, barValue] in fooBarMap" >
  {{fooKey}} is {{barValue}}
...

from here - vuejs/vue#6644 (comment)
P.S. Will work only with Vue 3, but not with Vue 2