How to test vue router beforeRouteUpdate navigation guard?
问题 First off, I'm using Vue-property-decorator. My component has a component route, defined like this. @Component({ components: { ComponentA, ComponentB }, beforeRouteUpdate (to, _from, next) { const { checkInDate, checkOutDate, items, currency, locale } = to.query; const queryFullfilled = !!checkInDate && !!checkOutDate && !!items.length && !!currency && !!locale; if ([BOOKING_PAGE, RESERVATION_PAGE].indexOf(to.name) > -1 && queryFullfilled) { this.validateRooms(); } next(); } }) export default