I'm attempting to add a custom handler InlineButtonClickHandler
to a <router-link>
component's click
event, so that I can emit a custom appSidebarInlineButtonClick
event.
But, my code isn't working. What am I doing wrong?
<template>
<router-link :to="to" @click="InlineButtonClickHandler">
{{ name }}
</router-link>
</template>
<script type="text/babel">
export default {
props: {
to: { type: Object, required: true },
name: { type: String, required: true }
},
methods: {
InlineButtonClickHandler(event) {
this.$emit('appSidebarInlineButtonClick');
}
}
}
</script>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…