Skip to content

[vue-compat] globalProperty with function as value is always bound to instance proxy #4403

@Fiona-SUN

Description

@Fiona-SUN

Version

3.2.4

Reproduction link

https://github.com/Fiona-SUN/vue3-minimal-reproduction

Steps to reproduce

  1. update vue to 3.2.4, install @vue/compat of the same version
  2. install UI Components Vant 3.2.0
  3. Global Register Toast (eg: https://youzan.github.io/vant/v3/#/en-US/quickstart#cdn)
  4. use this.$toast.loading in .vue file

What is expected?

The project should run on Vue 3 with Vant.

What is actually happening?

Uncaught(in promise) TypeError: this.$toast.loading is not a function.project broken


PublicInstanceProxyHandlers function use Function.prototype.bind() cause Toast lost some properties.
if there have any other methos to resolve the problem instead of Function.prototype.bind().

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't workingscope: v2 compat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions