Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
How to make the loop (v-for) dynamic inside h (Vue.JS) function?

I have a reactive variable list either ref or reactive

in a vue.Js project

and i create an app that depends on this list(reactive)

let list = ref(['item']);

let vNode = h(
  'ul',
  list.value.map((v, i) => { return h('li', { key: i }, v) })
);

let customApp = createApp(vNode);

customApp.mount('#trial')

when list changes the mounted component doesn't change, how can i make it dynamic and sync with list?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

the problem was solved using a component not a vnode.

let list = ref(['item']);

const comp = defineComponent({
  setup() {
    const arr = computed(() => toastsList.value);

    // or use list.value directly
    return () => h('ul',arr.value.map((v, i) => { return h('li', { key: i }, v) }));
  },
});

createApp(comp).mount('#trial');
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!