我在尝试把Basic form这些组件抽离出来组成一个组件库的时候碰到了一个警告
inject() can only be used inside setup() or functional components.
然后我根据控制台提供的调用堆栈 发现了警告在useContext.ts这个hook当中
这个问题在开发环境的时候不会出现 打包后就出现了
Expected behaviour
What should happen? Please describe the desired behaviour.
Subject of the feature
Problem
我在尝试把Basic form这些组件抽离出来组成一个组件库的时候碰到了一个警告 inject() can only be used inside setup() or functional components. 然后我根据控制台提供的调用堆栈 发现了警告在useContext.ts这个hook当中 这个问题在开发环境的时候不会出现 打包后就出现了
Expected behaviour
What should happen? Please describe the desired behaviour.
Alternatives
是否可以使用Map来替代Vue3的provide和inject?