Cannot convert object to primitive value with imported json

Cannot convert object to primitive value with imported json

<br>


I'm trying to dynamically build a vuetify component in a nuxt project (Using different text values with vuetify component) by importing and iterating through json in a module (https://hackernoon.com/import-json-into-typescript-8d465beded79).

My json in /static/info.json is:

{
  "id": 1,
  "name": "Johnson, Smith, and Jones Co.",
  "amount": 345.33,
  "Remark": "Pays on time"
}

In my vue component I have:

  import * as data from '../static/info.json';

const word = data.name;

console.log(word); // output 'testing' console.log(data); // output 'testing' var jsonData = JSON.parse(data); // console.log(jsonData); // output 'testing'

The line:

  var jsonData = JSON.parse(data);

causes:

 Cannot convert object to primitive value 

How can I iterate through the imported json?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How to build enterprise Vue.js applications with Nuxt?

Learn How to build enterprise Vue.js applications with Nuxt: Nuxt is a progressive framework based on Vue.js to create modern web applications. It is based on Vue.js official libraries (vue, vue-router and vuex) and powerful development tools (webpack, Babel and PostCSS). Nuxt goal is to make web development powerful and performant with a great developer experience in mind.

Responsive ecommerce template built with Vue.js and Nuxt.js

Responsive ecommerce template built with Vue.js and Nuxt.js

Nuxt.js: a Minimalist Framework for Creating Universal Vue.js Apps

In this article, you'll learn how we can take advantage of Nuxt.js to build server-rendered JavaScript applications with Vue.js. Learn how to use its generate command to generate static files for our pages, and deploy them quickly via a service like Firebase Hosting.