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 reference this (Vue instance) #62

Closed
haexhub opened this issue Jun 1, 2019 · 1 comment · Fixed by #72
Closed

How to reference this (Vue instance) #62

haexhub opened this issue Jun 1, 2019 · 1 comment · Fixed by #72

Comments

@haexhub
Copy link

haexhub commented Jun 1, 2019

Hi,

I would like to know, how to refer to the Vue instance in computed properties.

this works

  computed: {
    menu: sync('fancy_module/[email protected]')
  }

this not

  data () {
    return {
      foobar: 'fancy_module/[email protected]'
    }
  }

, computed: {
    menu: sync(this.foobar)
  }

this is not referencing to Vue.
I know that arrow functions bring a new this context. But I don't use it here, do I?
Any advie would be great.

@davestewart
Copy link
Owner

Hey @haexhub

This seems to come up a lot, so I'll probably add some documentation on how to handle this.

In the meantime, see this issue and the comments / links:

#28

I think I might add a helper as well, so this kind of thing is easy.

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

Successfully merging a pull request may close this issue.

2 participants