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

computed option with arrow function not work as 2.x #733

Closed
tooppoo opened this issue Feb 17, 2020 · 0 comments
Closed

computed option with arrow function not work as 2.x #733

tooppoo opened this issue Feb 17, 2020 · 0 comments

Comments

@tooppoo
Copy link

tooppoo commented Feb 17, 2020

Version

3.0.0-alpha.4

Reproduction link

https://github.com/tooppoo/vue-next/tree/computed-option-with-arrow-function-not-work

Steps to reproduce

  1. clone forked repository in link to minimal reproduction
  2. run test.
yarn test ./packages/runtime-core/__tests__/apiOptions.spec.tsyarn test ./packages/runtime-core/__tests__/apiOptions.spec.ts

What is expected?

computed property with arrow function can access to vue instance in first argument.

What is actually happening?

arrow function can not access to vue instance in first argument. value of the argument is undefined.


Computed property with arrow function worked on vue2.6.
Please see

Or is this deprecated?

If this problem should be fixed, apiOptions.ts l.305 and l.310 may need to be fixed.
I think they should pass context object to #bind not only in the first argument but also in the second argument.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant