[Vuejs]-Can you give analogy with v-for in Stencil ? (something like v-for in Stencil)

3👍

According to the docs:

Loops can be created in JSX using either traditional loops when creating JSX trees, or using array operators such as map when inlined in existing JSX.

So

render() {
  return (
    <div>
      {this.items.map((item) =>
        <div>
          <div>{item.name}</div>
        </div>
      )}
    </div>
  )
}

should be about equivalent to

<div v-for="item in items">
  <div>{{ item.name }}</div>
  ...
👤jack

Leave a comment