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

Check to see if there are props when passing props to setup #437

Open
doug-wade opened this issue Aug 20, 2023 · 0 comments
Open

Check to see if there are props when passing props to setup #437

doug-wade opened this issue Aug 20, 2023 · 0 comments
Labels
core enhancement New feature or request

Comments

@doug-wade
Copy link
Owner

Currently, we have this example in the docs

defineComponent({
    name: 'setup-context',
    setup({}, { emit }): {
        emit('mounted');
    }
});

Which isn't aesthetically pleasing. We can check to see if props has one or more keys, and pass the context as the first argument instead, which would allow us to do the following

defineComponent({
    name: 'setup-context',
    setup({ emit }): {
        emit('mounted');
    }
});
@doug-wade doug-wade added enhancement New feature or request core labels Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant