0

I try like this :

<template>
    ...
</template>
<script>
    export default {
        ...
        data() {
            return {
                tabs: [
                    {
                        sale:{
                            {
                                url: 'store/sale',
                                group: 'index'
                            },
                            {
                                url: 'store/confirm',
                                group: 'confirm'
                            },
                        },
                        purchase:{
                            {
                                url: '/profile/purchase',
                                group: 'payment'
                            },
                            {
                                url: '/profile/purchase/order',
                                group: 'order'
                            },
                        }
                    }
                ]
            }
        },
        ...
    }
</script>

If the code executed, there exist error :

Uncaught Error: Module build failed: SyntaxError: Unexpected token

It seems the error occurred in the data

How can I solve the error?

1 Answer 1

2

This is a syntax error:

sale:{
      {
        url: 'store/sale',
        group: 'index'
      },
      {
        url: 'store/confirm',
        group: 'confirm'
      },
     }

Same with purchase:{{})

I suspect you want those to be arrays (made with [ ]) not objects (with { }). Maybe this is what you are trying to do:

sale:[
      {
        url: 'store/sale',
        group: 'index'
      },
      {
        url: 'store/confirm',
        group: 'confirm'
      },
     ],
purchases[{
  // etc.
     }
    ]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.