0👍
I don’t think there is a way, but if there was then it couldn’t be considered optional. I suggest simply passing in the string ‘all’ if filters.getId()
is null
updateRoute(): void {
const filters = this.filters;
const router = this.$router;
let routeId = filters.getId()
if (!routeId && filters.handedSlug()) {
routeId = 'all'
}
router.push({
name: 'Person',
params: {
id: routeId,
handedSlug: filters.handedSlug(),
},
});
},
- [Vuejs]-Vue3 Plugin giving error 'does not provide an export named 'default'' – how do I export it?
- [Vuejs]-How can i use dynamic component in Nuxt.js 3
Source:stackexchange.com