2.5.13
https://codesandbox.io/s/o7mxm731n6
Try to pass listeners like this
const Decorator = {
functional: true,
render(h, {props, listeners}) {
return (
<DecoratedComponent
{...{ props, listeners }}
/>
);
}
};
export default Decorator;
events emitted from DecoratedComponent should be emitted from Decorator to it's parent component
parent component doesn't receive anything
There's no examples in docs, so maybe I'm using it wrong way
listeners is just an alias for data.on. I'm not sure about the syntax in jsx to only pass the on: listeners but you can spread the whole data object from context
<MyButton
{...props}
{...data}
/>
or
{...{on: listeners}}
If there's something not working that should work (everything looks fine to me), you can fire an issue on https://github.com/vuejs/babel-plugin-transform-vue-jsx.
Also, if you think we could improve docs by adding some sample code to the guide, make sure to open a PR there too 馃檪 (https://github.com/vuejs/vuejs.org/)
Most helpful comment
listenersis just an alias fordata.on. I'm not sure about the syntax in jsx to only pass theon: listenersbut you can spread the wholedataobject fromcontextor
If there's something not working that should work (everything looks fine to me), you can fire an issue on https://github.com/vuejs/babel-plugin-transform-vue-jsx.
Also, if you think we could improve docs by adding some sample code to the guide, make sure to open a PR there too 馃檪 (https://github.com/vuejs/vuejs.org/)