Skip to content

Temp vars via ":set" and _renderEffect order #270

Open
@altrusl

Description

Creation of temporary variable in v-for loops is not documented but in some cases is very helpful in Vue 2 and Vue 3:

  <p v-for="user in users" >
    <span :set="u = user">
    id: {{ u.id }}, name: {{u.name}}
    </span>
  </p>

In Vapor it is broken because of the order of _renderEffect's

    _renderEffect(() => _setText(n2, " id: ", _ctx.u.id, ", name: ", _ctx.u.name))
    _renderEffect(() => _setDynamicProp(n2, "set", _ctx.u = _ctx0[0]))

Sandbox

Shouldn't it be supported in the Vapor mode too?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions