Check to see if there are props when passing props to setup
Opened this issue · 0 comments
doug-wade commented
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');
}
});