You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Putting a v-memo on a template that has a for loop is discouraged by the linter but totally possible (and extremely useful in my case). However, this code:
<template>
<templatev-for="loflist" :key="l"v-memo="[someVal]">
<div>
{{ l }}
</div>
</template>
</template>
transpiles to this:
functionrender(_ctx,_cache,$props,$setup,$data,$options){return(_openBlock(true),_createElementBlock(_Fragment,null,_renderList(_ctx.list,(l,__,___,_cached)=>{const_memo=([someVal])if(_cached&&_cached.key===l&&_isMemoSame(_cached,_memo))return_cachedconst_item=(_openBlock(),_createElementBlock("div",{key: l},_toDisplayString(l),1/* TEXT */))_item.memo=_memoreturn_item},_cache,0),128/* KEYED_FRAGMENT */))}
As you can see, the value in memo is missing the _ctx
What is expected?
A _ctx for all memo values
What is actually happening?
no ctx
Funny enough a workaround for this is to manually put a _ctx in front of the values in the template. However, this only works as long as the internals of the template transpiler stay the same
The text was updated successfully, but these errors were encountered:
Version
3.2.27
Reproduction link
sfc.vuejs.org/
Steps to reproduce
Putting a v-memo on a template that has a for loop is discouraged by the linter but totally possible (and extremely useful in my case). However, this code:
transpiles to this:
As you can see, the value in memo is missing the _ctx
What is expected?
A _ctx for all memo values
What is actually happening?
no ctx
Funny enough a workaround for this is to manually put a _ctx in front of the values in the template. However, this only works as long as the internals of the template transpiler stay the same
The text was updated successfully, but these errors were encountered: