mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
import{V as p}from"./styles-f80fb1c9.js";import{d as m,ag as w,A as d,b as c,c as f,w as o,e as g,h as n,g as t,f as r,u as _}from"./index-898bbf46.js";import"./vue.runtime.esm-bundler-d4a3f7f4.js";const b={class:"card-header"},v={class:"font-medium"},x={class:"font-medium"},L=m({name:"JsonEditor",__name:"index",setup(k){const i={status:200,text:"",error:null,config:void 0,data:[{news_id:51184,title:"iPhone X Review: Innovative future with real black technology",source:"Netease phone"},{news_id:51183,title:"Traffic paradise: How to design streets for people and unmanned vehicles in the future?",source:"Netease smart",link:"http://netease.smart/traffic-paradise/1235"},{news_id:51182,title:"Teslamask's American Business Relations: The government does not pay billions to build factories",source:"AI Finance",members:["Daniel","Mike","John"]}]},e=w({val:JSON.stringify(i),data:i,showLine:!0,showLineNumber:!0,showDoubleQuotes:!0,showLength:!0,editable:!0,showIcon:!0,editableTrigger:"click",deep:3});return d(()=>e.val,a=>{try{e.data=JSON.parse(a)}catch{}}),d(()=>e.data,a=>{try{e.val=JSON.stringify(a)}catch{}}),(a,s)=>{const l=c("el-link"),h=c("el-card");return g(),f(h,{shadow:"never"},{header:o(()=>[n("div",b,[n("span",v,[t(" JSON编辑器组件,采用开源的 "),r(l,{href:"https://github.com/leezng/vue-json-pretty",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:o(()=>[t(" vue-json-pretty ")]),_:1}),t(" (支持大数据量)。 ")]),n("span",x,[t(" 当然我们还有一款代码编辑器组件推荐(这里就不做演示了),采用开源的 "),r(l,{href:"https://github.com/surmon-china/vue-codemirror",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:o(()=>[t(" codemirror6 ")]),_:1})])])]),default:o(()=>[r(_(p),{data:e.data,"onUpdate:data":s[0]||(s[0]=u=>e.data=u),deep:e.deep,"show-double-quotes":e.showDoubleQuotes,"show-line":e.showLine,"show-length":e.showLength,"show-icon":e.showIcon,"show-line-number":e.showLineNumber,editable:e.editable,"editable-trigger":e.editableTrigger},null,8,["data","deep","show-double-quotes","show-line","show-length","show-icon","show-line-number","editable","editable-trigger"])]),_:1})}}});export{L as default};
|