Vue 3:不推荐使用 getCurrentInstance() 吗?

Vue 3: Is getCurrentInstance() deprecated?

我在一些旧的(?)文档和代码中看到了对 getCurrentInstance() 函数的引用,但在当前的 Vue 3 文档中找不到它。

getCurrentInstance() 是否已弃用?

如果是,原因是什么? (inject()考虑够了吗?)如果没有,为什么我在文档中找不到?

我认为 getCurrentInstance() 的文档被不小心删除了...

getCurrentInstance() 最初是 documented in 4-Oct-2020, but that was later removed in 31-Aug-2021 由 Vue 的创建者(Evan You)对 Composition API 文档进行的主要重构。目前尚不清楚删除这些文档是否是故意的,因为 getCurrentInstance() 仍然:

我暂时认为它是未记录 API。但是,Evan 可能打算将其设为 internal API only.