Problem with Proxy and binding context
Version
3.0.11
Reproduction link
https://jsfiddle.net/npjw7dLf/13/
Steps to reproduce
- bind context for method in a class constructor
- Create a class instance from Vue.reactive
- call method
What is expected?
Method call with the Proxy context as in Vue.reactive
What is actually happening?
Method call with the original context
According to the reproduction you gave, this is expected behavior. When Module
's constructor is executed, everything is not reactive, so you bind the original instance of ModuleChild
as the context object instead of the reactive version of ModuleChild's instance. This is why the execution of setNewItemMediatorProblem
will not trigger the update.
So you need to wrap it as reactive when creating a ModuleChild
instance, see https://jsfiddle.net/HcySunYang/a13u2ebo/1/