how to specify menu items with URL Params
Posted: 27 Feb 2020, 16:25
I'm building an menu in the side bar with separate containers for creating and editing blog posts
Now I want to understand how to add the slug that is used to fetch the blog from REST API to the edit url; typically we would access an existing blog using the URL
using
Code: Select all
createMenu() {
this.menu = [
{
label: 'Blogs', icon: 'fas fa-blog',
items: [
{label: 'All', icon: 'fas fa-list', to: '/blogs'},
{label: 'New', icon: 'fas fa-pen', to: '/blogs/create'},
{label: 'Edit', icon: 'fas fa-pen', to: '/blogs/edit'},
]
}
];
}
Code: Select all
/api/blogs/then-a-slug-to-blog
doesn't work.blogs/edit/:slug