Vue js activereport js problem adding parameter to router

Posted by: khaingsumyatnoepko on 8 February 2021, 8:45 pm EST

  • Posted 8 February 2021, 8:45 pm EST

    Hi,

    I got error when I declare parameter in my path url..

    in my router.js

    {
    path: '/report/:x',
    name:'testReport',
    component: testReport,
    meta: {
    requiresAuth: true,
    title: 'message.ecommerce',
    breadcrumb: null
    }
    },

    In my report.vue I want to extract the url parameter and pass the parameters to the activereport js..
    here is my code

    <template>
    <div id="viewer-host">
    <JSViewer v-bind:report="{Uri: 'report.rdlx-json', Params: {x:code}}"></JSViewer>

    </div>
    </template>

    <script>
    export default {
    name: "App",
    data(){
    return{
    code: [],

    }

    },
    components: {
    JSViewer: Viewer,
    },

    async created()
    {
    let code = this.$router.params.x

    this.code.push(code)

    },
    </script>
  • Replied 9 February 2021, 7:53 pm EST

    Hello,

    Could you please try with the following code:
    Params: {x:[code]}}

    Thanks,
    Mohit
  • Marked as Answer

    Replied 9 February 2021, 7:53 pm EST

    Hello,

    Could you please try with the following code:
    Params: {x:[code]}}

    Thanks,
    Mohit
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels