Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
How to pass dynamic params to name route - Vue JS

I have this LayoutVertical.vue parent component:

<script>
import LayoutVertical from "@core/layouts/layout-vertical/LayoutVertical.vue";
import AppCustomizer from "@core/layouts/components/app-customizer/AppCustomizer.vue";
import { $themeConfig } from "@themeConfig";
import navMenuItems from "@/navigation/vertical";

export default {
    components: {
        AppCustomizer,
        LayoutVertical,
    },
    data() {
        return {
            showCustomizer: $themeConfig.layout.customizer,
            navMenuItems,
        };
    },
};
</script>

This navMenuItems property contained:

export default [
    {
        header: "Projects",
    },
    {
        title: "Import",
        route: {
            name: "project-import",
            params: { token: token },
        },
        icon: "SettingsIcon",
    },
];

And the route for this:

{
    path: "/project/import/view/:token",
    name: "project-import",
    props : true,
    component: () =>
        import("@/views/apps/projects/project-import/ProjectImport.vue"),
},

Now, I have another compnent called AppNavbarVerticalLayout.vue which is child component of that parent. In this component I have a onChange methods called chooseProject. From this method I can get a token value.

My question is how can I pass this token value to that navMenuItems property's params?

Can I set a params for a specific name route?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!