mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
helper(Json.js):adds new helper component to display JSON data in the template, that can be used globally inside a vuejs app
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
props:{
|
||||
data:{
|
||||
type:Object|String,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
componentData: function(){
|
||||
if(!this.data){
|
||||
return "Pass data to be printed by adding the :data prop on the component";
|
||||
}
|
||||
return JSON.stringify(this.data, null, 2);
|
||||
},
|
||||
},
|
||||
template:`<pre class="p-2 bg-secondary text-white" >{{componentData}}</pre>`
|
||||
}
|
||||
Reference in New Issue
Block a user