-
Notifications
You must be signed in to change notification settings - Fork 132
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
on
doesn't work for Lifecycle Hooks
#166
Comments
@ArmorDarks, can you provide an example on the alternative in vue template? |
In regular Vue templates it would be <template>
<HelloWorld @hook:created="log" />
</template>
<script>
import MyComponent from "./components/MyComponent.vue";
export default {
name: "App",
components: { MyComponent },
methods: {
log () { console.log('hi from created') }
}
};
</script> |
hmm.. here's a way to do that, I will think about some syntax for it. For now you can use spread to achieve the same result as shown here |
Another one: |
I see a problem bigger, there's no reason for people not to use namespaced events in the first place, so we should probably support the full namespaced version like |
Not sure it worth it. |
@ArmorDarks, how does transpiler know if it's supposed to be |
Same way as it knows that It just assumes that when you say |
@ArmorDarks, yeah, that's done by parsing the |
I thought But following the logic of other JSX events, should it be |
Have you solved your problem? I meet the same problem |
Example
Expected
On creation to log
Actual
Nothing happens
Looks like Lifecycle Hooks not available through jsx. I've tried
onCreated
,onHookCreated
,onCreatedHook
,hookCreate
and so on — nothing works.The text was updated successfully, but these errors were encountered: