Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mpuz opened this issue Oct 8, 2022 · 1 comment
Closed

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

mpuz opened this issue Oct 8, 2022 · 1 comment

Comments

@mpuz
Copy link

mpuz commented Oct 8, 2022

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
Copy link
Author

mpuz commented Oct 8, 2022

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

@mpuz mpuz closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant