Use ES6 syntax for hooks in transition key

This commit is contained in:
Sébastien Chopin 2017-01-26 16:01:22 +01:00
parent d9fe4b9612
commit a99161f685

View File

@ -41,7 +41,12 @@ require('<%= pluginPath %>')
// root instance
// here we inject the router and store to all child components,
// making them available everywhere as `this.$router` and `this.$store`.
const defaultTransition = <%= serialize(transition) %>
const defaultTransition = <%=
serialize(transition)
.replace('beforeEnter(', 'function(').replace('enter(', 'function(').replace('afterEnter(', 'function(')
.replace('enterCancelled(', 'function(').replace('beforeLeave(', 'function(').replace('leave(', 'function(')
.replace('afterLeave(', 'function(').replace('leaveCancelled(', 'function(')
%>
const app = {
router,
<%= (store ? 'store,' : '') %>