[Vuejs]-V-if inside v-for in vue.js

0👍

just like this.

hotels = []
axios.get("hotels").then( (data) => {
  hotels = data
})

just ignored that axios.get its just example that data came from backend. so as you can see hotels came from the request right or in the backend so to put a show property for that first thing is to know the condition what hotel should i show or hide.

hotels = []
axios.get("hotels").then( (data) => {
  if (data.slot === 0 )
    data.show = true
  else data.show = false

  hotels = data
})

just like that. i just check if the slot is equals to zero so i will not show that hotel. just for example. something like that

Leave a comment