Subscribe on changes!

How does render function use the ``v-memo`` directive

avatar
Sep 13th 2021

Version

3.2.11

Reproduction link

github.com/vuejs/vue-next

Steps to reproduce

In setup context.

console.log(resolveDirective('v-memo'));
console.log(resolveDirective('memo'));
console.log(resolveDirective('Memo'));

The results are all of undefined.

How use the v-memo directive in render function?

What is expected?

At least one that returns a correct directive.

What is actually happening?

Results are all of undefined.

avatar
Sep 13th 2021

When i searching the keyword v-memo in vue-next, Only have some document file as result. But use the memo keyword, Using memo directive correct method in render function be found by me.

export function withMemo(
  memo: any[],
  render: () => VNode<any, any>,
  cache: any[],
  index: number
)

It is not directive.

avatar
Sep 13th 2021

We should be like using v-for. Caching VNode uses self implementation.