Skip to content

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

@tooppoo

Description

@tooppoo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions