I'm trying to build an application where I'm trying to get values, everything was working fine,
Here is my code: https://codeshare.io/aY7rX3
But suddenly some error started coming:
Avoid using non-primitive value as key, use string/number value instead
Somewhere around:
<div class="col-sm-4 border-right">
<div>
<button @click.prevent="" v-for="(obj, key) in tags"
:key="key"
class="btn btn-rounded btn-sm"
:class="tagParentClass(key)">
{{key}}
</button>
</div>
</div>
The data set of tags
export const tags = {
Investor: [
{display: "Mutual Fund", value: 'Mutual Fund'},
{display: "Insurance", value: 'Insurance'},
{display: "FII", value: 'FII'},
{display: "PMS", value: 'PMS'},
{display: "Proprietary", value: 'Proprietary'},
{display: "HNI", value: 'HNI'},
{display: "Private Equity", value: 'Private Equity'},
{display: "Others", value: 'Others'}
],
Research: [
{display: "Global", value: 'Global'},
{display: "Domestic", value: 'Domestic'},
{display: "Retail", value: 'Retail'},
{display: "Others", value: 'Others'}
],
Corporate: [
{display: "Corporate", value: 'Corporate'}
],
Others: [
{display: "Debt", value: 'Debt'},
{display: "Debt Adviser", value: 'Debt Adviser'},
{display: "Investment Banker", value: 'Investment Banker'},
{display: "Media", value: 'Media'},
{display: "Others", value: 'Others'}
]
}
Help me out in this.
Try changing the JSON format of tags.
The warning message will disappear if you modify your JSON Format to below format
i have updated your JSON format to a more friendlier JSON Format that is used in most usecases.
Try this approach and let me know if it works
Template
Script
in object
tags
you have nested objects in the arrayif you want pass all
tags