在script setup中使用getCurrentInstance生产无法获取setupState #8516
Unanswered
Zero1306
asked this question in
Help/Questions
Replies: 3 comments 1 reply
-
问题背景,项目需要做持久化缓存,需要获取类似vue2中的$data数据去存储 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
This is due to the fact that Vue uses different compilation modes (inline) in dev and prod builds, which is the design. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Vue version
3.3.4
Link to minimal reproduction
https://play.vuejs.org/#__DEV__eNplkEFPhDAQhf/K2AuQrDRetRDNXvSqJl64VJhliaVtyhRNCP/dAdw1useZ982beTOJB+/zMaK4FWqoQ+cJBqToy8p2vXeBYIKAhx20SPsYAlp6sgNpW+MOyD3rT5jhEFwPCbskla1s7RiAfmihWEbT5BGNcfDmgmmukuwX6X6MmLt0T7O7E3fUtjH4igPtTVd/MJ5mUJQwsRVJyZvyUZu4+KwXpSdj3gWweDiDuXHtX0EbDHRu5WvsF9KEOTsyMS+XKrl9hf/BBWHvDRNcAajjTTlNa9B5VpKrtdtZHwnG6941aIpKsF6JTXqPRM7Cfb3EYOlfMMYIvwhWWcmN5kklz3vF/A32HJoO
Steps to reproduce
What is expected?
prod环境下点击test click能正常获取msg
What is actually happening?
No response
System Info
No response
Any additional comments?
No response
Beta Was this translation helpful? Give feedback.
All reactions