use this code:

<div id="vueapp">
  <textarea v-model="jsonstr" rows="8" cols="40"></textarea>
  <pre>{{ jsonstr | pretty }}</pre>
</div>

and JS:

new Vue({
  el: '#vueapp',
  data: {
    jsonstr: '{"id":1,"name":"A green door","price":12.50,"tags":["home","green"]}'
  },
  filters: {
    pretty: function(value) {
      return JSON.stringify(JSON.parse(value), null, 2);
    }
  }
})
Answer from Behnam on Stack Overflow
🌐
Siongui
siongui.github.io › 2017 › 03 › 15 › vuejs-pretty-print-json-string
[Vue.js] Pretty Print JSON String - Theory and Practice
Paste any valid JSON string in the following textarea. You will see the result of pretty print on the fly. ... <div id="vueapp"> <textarea v-model="jsonstr" rows="8" cols="40"></textarea> <pre>{{ jsonstr | pretty }}</pre> </div> <script src="https://unpkg.com/vue@2.2.4/dist/vue.js"></script>
Discussions

How to print JSON data in a loop in Vue.js
I want to print it in a loop and want to display like · East Delhi lastupdatedtime North west lastupdatedtime ... I tried but I am getting only lastupdatedtime. Can anyone help? Thanks in advance. ... What is jsonData here? also the "JSON Data" you have shared has no id property then how are you assigning :key="data.id"? ... i am fetching data using api call and storing it into jsonData object and :key="data.id" is necessary in vuejs ... More on stackoverflow.com
🌐 stackoverflow.com
March 28, 2020
Iterate over JSON and print values in Vue.js
I am quite new to Vue and am attempting to retrieve a JSON response from an API and then print this on my page. This is what I have so far: More on stackoverflow.com
🌐 stackoverflow.com
Show json result with vue.js
Hi i am try to show json file result with vue.js the target is that result will be showed on value. More on stackoverflow.com
🌐 stackoverflow.com
February 7, 2022
Display pretty print of JSON in Vue.js - javascript
I wonder how do people display pretty print of JSON in Vue.js More on stackoverflow.com
🌐 stackoverflow.com
🌐
npm
npmjs.com › package › vue-json-pretty
vue-json-pretty - npm
October 28, 2025 - Now it supports Vue3 at least. If you still use Vue2, see 1.x. ... As a JSON Formatter.
      » npm install vue-json-pretty
    
Published   Oct 28, 2025
Version   2.6.0
Author   leezng
🌐
GitHub
github.com › cars10 › vue-print-object
GitHub - cars10/vue-print-object: A vuejs component to print javascript objects
Print javascript objects · ... objects on hover · First add it to your package.json: npm install vue-print-object --save # or yarn yarn add vue-print-object ·...
Author   cars10
🌐
GitHub
github.com › tanmancan › vue-json-print
GitHub - tanmancan/vue-json-print: Pretty prints JSON object in a collapsible tree view
import JsonTree from 'vue-json-print' import Vue from 'vue'; Vue.component('json-tree', JsonTree);
Author   tanmancan
Find elsewhere
🌐
npm
npmjs.com › package › vue-json-print
vue-json-print - npm
December 21, 2019 - Latest version: 0.3.2, last published: 6 years ago. Start using vue-json-print in your project by running `npm i vue-json-print`. There are no other projects in the npm registry using vue-json-print.
      » npm install vue-json-print
    
Published   Dec 21, 2019
Version   0.3.2
Author   Tanveer Karim
🌐
Stack Overflow
stackoverflow.com › questions › 70531704 › print-a-page-with-details-from-json-file-in-vue
Print a page with details from Json file in Vue
December 30, 2021 - How should I setup GameDetail.vue to print just one Game, lets say if the path is /en/game/foo or /en/game/bar ... <template> <div> <div v-for="game in getData($route.params.slug)" :key="game.slug"> {{ game.title }} {{ game.image }} </div> </div> </template> <script> import json from '../../assets/data/games.json' export default { props: ['slug'], data() { return { games: json, playerOptions: { // videojs options muted: false, language: 'en', height: '600', volumeControl: false, playbackRates: [0.7, 1.0, 1.5, 2.0], sources: [{ type: "video/mp4", src: "/mov/CockroachRacers.mp4" }], poster: "/mov/CockroachRacers.jpg", }, } }, methods: { getData(slug) { let data = this.games data.filter(item => { return item.slug == slug }) } } } </script>
🌐
Renat Galyamov
renatello.com › home › javascript/vue.js print object in the console
JavaScript/Vue.js print object in the console – Renat Galyamov
February 11, 2021 - Here is a short and sweet tip on how to print JavaScript object using console.log(). ... To print out the content of person, you first need to stringify it using JSON.stringify() method.
🌐
Medium
medium.com › @renatello › javascript-vue-js-print-object-in-the-console-177e69cb2f67
JavaScript/Vue.js print object in the console | by Renat Galyamov | Medium
May 25, 2019 - Here is a short and sweet tip on how to print JavaScript object using console.log(). ... To print out the content of person, you first need to stringify it using JSON.stringify() method.
🌐
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.
Now it supports Vue3 at least. If you still use Vue2, see 1.x. ... As a JSON Formatter.
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%
🌐
SiMedia Tech
simedia.tech › blog › js-quickie-pretty-printing-a-json-object-without-external-dependencies
JS-Quickie: pretty-printing a JSON object without external dependencies
April 15, 2021 - I've been implementing an external API interface recently and during the implementation, one task was to add a log entry to the database for the request and response payload (JSON) and display those payloads inside a user interface.
🌐
Vue Script
vuescript.com › home › 7 best json viewer libraries for vue.js applications (2026 update)
7 Best JSON Viewer Libraries For Vue.js Applications (2026 Update) - Vue Script
December 29, 2025 - There are a number of libraries available to help you view your JSON data in a more user-friendly manner, and the number is sure to grow. In this article, we have provided you with seven of the top options for Vue.js developers, along with some real examples of how each library works in practice.