Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with the Property missing of ComponentPublicInstance? #1421

Closed
SSShooter opened this issue May 27, 2022 · 1 comment
Closed

How to deal with the Property missing of ComponentPublicInstance? #1421

SSShooter opened this issue May 27, 2022 · 1 comment

Comments

@SSShooter
Copy link

Version

4.0.15

Reproduction link

codesandbox.io

Steps to reproduce

data() {
    return {
      isMounted: true,
    }
  },
beforeRouteEnter(to, from, next) {
    next((vm) => {
      if (to.meta.from.includes(from.path) || vm.isMounted) {
        vm.isMounted= false
        vm.fetch()
      }
    })
  }

What is expected?

Be able to access isMounted of vm

What is actually happening?

Property 'mount' does not exist on type 'ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>'.

image

@SSShooter SSShooter changed the title How to deal with the type missing of ComponentPublicInstance? How to deal with the Property missing of ComponentPublicInstance? May 27, 2022
@posva
Copy link
Member

posva commented May 27, 2022

Duplicate of #701

@posva posva marked this as a duplicate of #701 May 27, 2022
@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants