(求助)将业务模块封装成个class到模板中直接使用的功能需求 #12873
Answered
by
l246804
Muspcn
asked this question in
Help/Questions
-
`
} // 模板中 const language = new LangUtils() // 这种会无效 const language = toReactive(new LangUtils()) // 必须这样才行,在class中不是声明了ref类型嘛,为什么要多加个toReactive呢 ` |
Beta Was this translation helpful? Give feedback.
Answered by
l246804
Feb 26, 2025
Replies: 2 comments 2 replies
-
模板中使用方法
|
Beta Was this translation helpful? Give feedback.
1 reply
-
const language = new LangUtils() // 这个是普通对象,没有被vue进行响应式代理(所以template中不会响应式更新) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
普通对象内部嵌套
ref
对象需要在模板里自己解构。