Having an issue with vue-router where routing doesn't work properly when trying to navigate to a child route.
{
path: '/user',
name: 'User',
component: User,
children: [
{
path: 'profile',
component: Profile,
},
],
}
Need help with programmatically routing to /user/profile
<template>
<div>
<button @click="goToUserProfile()">create new</button>
</div>
</template>
<script>
export default {
methods: {
goToUserProfile() {
this.$router.push('/user/profile') // Issue with routing
.catch(console.log);
},
},
};
</script>