Page 1 of 1

how to specify menu items with URL Params

Posted: 27 Feb 2020, 16:25
by anadi
I'm building an menu in the side bar with separate containers for creating and editing blog posts

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'},    
            ]
        }
      ];
    }
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

Code: Select all

/api/blogs/then-a-slug-to-blog
using
blogs/edit/:slug
doesn't work.