nodegui / vue-nodegui

Build performant, native and cross-platform desktop applications with native Vue + powerful CSS like styling.🚀
https://vue.nodegui.org
MIT License
805 stars 28 forks source link

Are v-if and v-for working? #92

Closed mpuz closed 1 year ago

mpuz commented 1 year ago

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 1 year ago

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 - https://github.com/vuejs/vue/issues/6644#issuecomment-832217799 P.S. Will work only with Vue 3, but not with Vue 2