为什么transform的返回会被缓存 #636
TSjianjiao
started this conversation in
General
Replies: 1 comment 2 replies
-
你好,方便提供一下在线最小demo吗 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
比如如下场景:
data
。将它设置为永久缓存。A
请求这个字典,组件需要数据格式为dataA
。B
,组件需要数据格式为dataB
。问题是上一个组件
transform
之后,导致下一个组件命中缓存时,获取到的数据不是原始数据格式。比如:
A
,此时转化路径是data
->dataA
,并缓存B
,如果命中缓存转化路径是是dataA
->dataB
,没有命中缓存则是data
->dataB
可以看到
B
组件需要对两种情况进行区分,而且不熟悉的甚至不知道为什么数据格式会变成dataA
而不是data
所以为什么不取消缓存
transform
的结果,命中缓存返回的永远都是原始数据格式data
Beta Was this translation helpful? Give feedback.
All reactions