You are looking for the Router instance’s resolve method:
Given location in form same as used in
<router-link/>, returns object with the following resolved properties:{ location: Location; route: Route; href: string; }
In your case you could do something like this to get the url:
let props = this.$router.resolve({
name: 'ProductDetail',
params: { id: some_id, slug: some_slug },
});
return props.href;