🌐
npm
npmjs.com › package › vue-json-component
vue-json-component - npm
January 10, 2020 - A VueJS JSON Tree View with no dependencies and module builds.. Latest version: 0.4.1, last published: 6 years ago. Start using vue-json-component in your project by running `npm i vue-json-component`. There are 9 other projects in the npm registry using vue-json-component.
      » npm install vue-json-component
    
Published   Jan 10, 2020
Version   0.4.1
Author   Tyler Krupicka
🌐
GitHub
github.com › tylerkrupicka › vue-json-component
GitHub - tylerkrupicka/vue-json-component: Component for rendering a tree view of JSON.
Component for rendering a tree view of JSON. Contribute to tylerkrupicka/vue-json-component development by creating an account on GitHub.
Starred by 85 users
Forked by 13 users
Languages   Vue 91.1% | JavaScript 6.4% | TypeScript 2.5% | Vue 91.1% | JavaScript 6.4% | TypeScript 2.5%
🌐
Storyblok
storyblok.com › tp › vue-dynamic-component-from-json
How to render dynamic component defined in JSON using Vue.js | Storyblok
August 22, 2019 - With Vue.js it is unbelievably easy to render dynamic components, which we can utilize to render content with specific components and layouts by only using their name. The content JSON below contains an array called body which consists of multiple objects with different fields and one attribute called component which allows us to determine what component we should use to render its content.
🌐
GitHub
github.com › leezng › vue-json-pretty
GitHub - leezng/vue-json-pretty: A JSON tree view component that is easy to use and also supports data selection.
A Vue component for rendering JSON data as a tree structure.
Starred by 1.4K users
Forked by 141 users
Languages   JavaScript 55.2% | TypeScript 26.3% | Vue 12.8% | Less 4.3% | HTML 1.4% | JavaScript 55.2% | TypeScript 26.3% | Vue 12.8% | Less 4.3% | HTML 1.4%
🌐
Vue Script
vuescript.com › home › json
Vue.js JSON Components - Vue Script
March 3, 2022 - Latest free Vue.js components for handling JSON data in your Vue application.
🌐
Myst729
myst729.github.io › vue-json-tree
vue-json-tree
import JsonTree from 'vue-json-tree' Vue.component('json-tree', JsonTree)
🌐
npm
npmjs.com › package › vue-json-pretty
vue-json-pretty - npm
October 28, 2025 - A Vue component for rendering JSON data as a tree structure.
      » npm install vue-json-pretty
    
Published   Oct 28, 2025
Version   2.6.0
Author   leezng
Top answer
1 of 4
4

Quick solution:

projectDetails.vue

<template>
    <div>
        <div>
            <h1>{{ projectDetails.title }}</h1>
            <p>{{ projectDetails.description }}</p>
        </div>
    </div>
</template>

<script>
    import json from '@/json/projectDetails.json';

    export default {
        name: 'projectDetails',
        props: {
            name: String,
        },
        data() {
            return {
                projectDetails: Object.values(json).find(project => project.title === this.name),
            };
        },
    };
</script>


In my opinion, a better solution:

I don't get the idea that you keep project data in 2 separate JSON files. During compilation, both files are saved to the resulting JavaScript file. Isn't it better to keep this data in 1 file? You don't have to use all of your data in one place. The second thing, if you have a project listing then you can do routing with an optional segment, and depending on whether the segment has a value or not, display the listing or data of a particular project. Then you load project data only in one place, and when one project is selected, pass its data to the data rendering component of this project. Nowhere else do you need to load this JSON file.

routes.js

import home from '@/components/home.vue';
import about from '@/components/about.vue';
import work from '@/components/work.vue';

const routes = [
    {path: '/', name: 'home', component: home},
    {path: '/about', name: 'about', component: about},
    {path: '/work/:name?', name: 'work', component: work, props: true},
];

export default routes;

work.vue

<template>
    <div>
        <project-details v-if="currentProject" :project="currentProject"/>
        <projectLink v-else 
                     v-for="project in projects"
                     v-bind="project"
                     v-bind:key="project.projectName"
        />
    </div>
</template>

<script>
    import projectLink from './projectLink';
    import projectDetails from './projectDetails';
    import json from '@/json/projectLink.json';

    export default {
        name: 'work',
        props: {
            name: String,
        },
        data() {
            return {
                projects: Object.values(json),
            };
        },
        computed: {
            currentProject() {
                if (this.name) {
                    return this.projects.find(
                        project => project.projectName === this.name,
                    );
                }
            },
        },
        components: {
            projectLink,
            projectDetails,
        },
    };
</script>

projectDetails.vue

<template>
    <div>
        <div>
            <h1>{{ project.title }}</h1>
            <p>{{ project.description }}</p>
        </div>
    </div>
</template>

<script>

    export default {
        name: 'projectDetails',
        props: {
            project: Object,
        },
    };
</script>

projectLink.vue (changed only one line)

<router-link v-if="projectName" :to="{ name: 'work', params: { name: projectName }}">

A full working example:

Vue.component("navigation", {
  template: "#navigation"
});

const Projects = {
  template: "#projects",
  props: ["projects"]
};
const Project = {
  template: "#project",
  props: ["project"]
};
const HomePage = {
  template: "#home"
};
const AboutPage = {
  template: "#about"
};
const WorkPage = {
  data() {
    return {
      projects: [{
          slug: "foo",
          name: "Foo",
          desc: "Fus Ro Dah"
        },
        {
          slug: "bar",
          name: "Bar",
          desc: "Lorem Ipsum"
        }
      ]
    };
  },
  props: {
    slug: String
  },
  template: "#work",
  components: {
    Projects,
    Project
  },
  computed: {
    currentProject() {
      if (this.slug) {
        return this.projects.find(project => project.slug === this.slug);
      }
    }
  }
};

const router = new VueRouter({
  routes: [{
      path: "/",
      name: "home",
      component: HomePage
    },
    {
      path: "/about",
      name: "about",
      component: AboutPage
    },
    {
      path: "/work/:slug?",
      name: "work",
      component: WorkPage,
      props: true
    }
  ]
});

new Vue({
  router,
  template: "#base"
}).$mount("#app");
ul.nav {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #333;
}

ul.nav>li {
  float: left;
}

ul.nav>li>a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

ul.nav>li>a:hover {
  background-color: #111;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.1.3/vue-router.min.js"></script>

<div id="app"></div>

<script type="text/x-template" id="base">
  <div id="app">
    <div>
      <navigation></navigation>
      <router-view></router-view>
    </div>
  </div>
</script>

<script type="text/x-template" id="navigation">
  <ul class="nav" id="navigation">
    <li>
      <router-link :to="{name: 'home'}">Home</router-link>
    </li>
    <li>
      <router-link :to="{name: 'about'}">About</router-link>
    </li>
    <li>
      <router-link :to="{name: 'work'}">Work</router-link>
    </li>
  </ul>
</script>

<script type="text/x-template" id="home">
  <div id="home">This is Home Page</div>
</script>

<script type="text/x-template" id="about">
  <div id="about">This is About Page</div>
</script>

<script type="text/x-template" id="work">
  <div id="work">
    <project v-if="currentProject" :project="currentProject"></project>
    <projects v-else :projects="projects"></projects>
  </div>
</script>

<script type="text/x-template" id="projects">
  <div id="projects">
    <ul>
      <li v-for="project in projects" :key="project.slug">
        <router-link :to="{name: 'work', params:{ slug: project.slug}}">{{project.name}}</router-link>
      </li>
    </ul>
  </div>
</script>

<script type="text/x-template" id="project">
  <div id="project">
    <h2>{{project.name}}</h2>
    <p>{{project.desc}}</p>
  </div>
</script>

2 of 4
3

Great work thus far, Austin! You're very close having this working. There are a few different ways you could parse out the correct data from your JSON file into the projectDetails component, but I'll just demo my preferred way.

First, you're going to need a bit of vanilla JS to search through your JSON file and return only the row that you want. I would do this as a method since the data isn't going to be changing or requiring the component to re-render. So, after your props, I would add something like this:

methods: {
  findProject(projectName) {
    return Object.values(json).find(project => project.title === projectName)
  }
}

Note that this is going to return the first project that matches the project name. If you have projects with the exact same project name, this won't work.

Next, you'll just need to update the default value of projectDetailsJson to call this method and pass the route's project name. Update data with something like this:

data() {
  return {
    projectDetailsJson: this.findProject(this.$route.params.name)
  }
}

If that doesn't work, we may need to set the projectDetailsJson in the created lifecycle hook, but try the above code first.

Find elsewhere
🌐
Vue.js Examples
vuejsexamples.com › tag › json
Json - Vue.js Examples
August 3, 2022 - Named Entity Recognition Annotation tool for SpaCy, Generates Traning Data as a JSON which can be readily used 07 November 2021 ... A Vue3 component that displays JSON in a collapsible tree. Inspired by vue-json-component and vue-json-tree-view to work with Vue3 and TypeScript.
🌐
Medium
harin76.medium.com › generate-vue-js-components-from-a-json-javascript-dom-structure-a76534478d15
Generate Vue.js components from a JSON / JavaScript DOM Structure | by Hari Narasimhan | Medium
June 13, 2017 - The Vue.js component provides a low level “render” property. The property is actually a function frequently referred to as createElement. The createElement function takes three arguments ...
🌐
GitHub
github.com › razorness › vue3-json-component
GitHub - razorness/vue3-json-component: Vue3 Component for rendering a tree view of JSON.
This is primary a fork of vue-json-component which was created to achieve quick Vue 3 support.
Author   razorness
🌐
GitHub
github.com › Metsavend › vue-json-component-vue-3
GitHub - Metsavend/vue-json-component-vue-3: vue-json-component-vue3
Now you can use it with vue 3 with no problem. I removed much much useless plugins here what user/client who is using this plugin does not need in their project. A collapsable tree view for JSON. This package has some similarites with vue-json-tree-view so I'll address the differences below.
Author   Metsavend
🌐
npm
npmjs.com › package › vue-json-viewer
vue-json-viewer - npm
Simple JSON viewer component, for Vue.js 2 or 3.
      » npm install vue-json-viewer
    
Published   Mar 03, 2022
Version   2.2.22
Author   陈峰
🌐
GitHub
github.com › myst729 › vue-json-tree
GitHub - myst729/vue-json-tree: Vue component that renders JSON data in a collapsible tree structure.
Vue component that renders JSON data in a collapsible tree structure. - myst729/vue-json-tree
Starred by 51 users
Forked by 13 users
Languages   Vue 52.1% | JavaScript 47.9% | Vue 52.1% | JavaScript 47.9%
🌐
npm
npmjs.com › package › vue3-json-component
vue3-json-component - npm
September 21, 2021 - A VueJS 3 JSON Tree View with no dependencies and module builds.. Latest version: 0.4.2, last published: 4 years ago. Start using vue3-json-component in your project by running `npm i vue3-json-component`. There are no other projects in the npm registry using vue3-json-component.
      » npm install vue3-json-component
    
Published   Sep 21, 2021
Version   0.4.2
Author   Volker Nauruhn