It would be great if all Vue directives would support .once: v-for.once, :class.once, v-if.once for situations where you know the binded data won't change. I imagine this will increase performance.
Sounds like a good idea.
Idea is nice! Additionally would it be good to allow this API level of the directive, for custom directives that may only ever need a single bind.
{
once: true,
}
@blake-newman if you supply only bind without update then it is "once" already :)
@yyx990803 Very true.. doh! We have now implemented this into 2.0, and the plan is to keep this functionality to 2.0 only.
Closing: @vuejs/collaborators reopen if there is a change of plan.
This proposal has been accepted yet?
Not in Vue 1. In Vue 2 you have v-once
Most helpful comment
@blake-newman if you supply only
bindwithoutupdatethen it is "once" already :)