Skip to content

Composition API in a functional component #1645

Closed
@baryla

Description

@baryla

Version

3.0.0-rc.2

Reproduction link

https://github.com/baryla/vue3-composition-api-functional-component

Steps to reproduce

  1. Run the yarn dev command
  2. Click on the button

What is expected?

I would expect the counter to increment

What is actually happening?

The counter is not incrementing


I'm not exactly sure if this is the desired behaviour but it feels a little strange that this doesn't work.

If it desired and Composition API should only work inside setup, maybe it's worth exploring the use inside a functional component and treating the whole function as a setup function? Kind of similar to this RFC where the whole script tag is considered a "setup" if it has the setup attribute.

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