mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 17:07:19 +08:00
2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
import{S as p}from"./vue-json-pretty-DYIyI-em.js";import{d as c,r as w,n as d,b as f,w as o,e as u,f as b,g as i,h as s,i as a,u as g}from"./index-AFhnwzwZ.js";const v={class:"card-header"},_={class:"font-medium"},k={class:"font-medium"},J=c({name:"JsonEditor",__name:"json-editor",setup(x){const l={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"]}]},t=w({val:JSON.stringify(l),data:l,showLine:!0,showLineNumber:!0,showDoubleQuotes:!0,showLength:!0,editable:!0,showIcon:!0,editableTrigger:"click",deep:3});return d(()=>t.val,n=>{try{t.data=JSON.parse(n)}catch(e){}}),d(()=>t.data,n=>{try{t.val=JSON.stringify(n)}catch(e){}}),(n,e)=>{const r=u("el-link"),h=u("el-card");return b(),f(h,{shadow:"never"},{header:o(()=>[i("div",v,[i("span",_,[e[2]||(e[2]=s(" JSON编辑器,采用开源的 ")),a(r,{href:"https://github.com/leezng/vue-json-pretty",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:o(()=>e[1]||(e[1]=[s(" vue-json-pretty ")])),_:1}),e[3]||(e[3]=s(" (支持大数据量)。 "))]),i("span",k,[e[5]||(e[5]=s(" 当然还有一款代码编辑器推荐(这里就不做演示了),采用开源的 ")),a(r,{href:"https://github.com/surmon-china/vue-codemirror",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:o(()=>e[4]||(e[4]=[s(" codemirror6 ")])),_:1})])]),a(r,{class:"mt-2",href:"https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/json-editor.vue",target:"_blank"},{default:o(()=>e[6]||(e[6]=[s(" 代码位置 src/views/components/json-editor.vue ")])),_:1})]),default:o(()=>[a(g(p),{data:t.data,"onUpdate:data":e[0]||(e[0]=m=>t.data=m),deep:t.deep,"show-double-quotes":t.showDoubleQuotes,"show-line":t.showLine,"show-length":t.showLength,"show-icon":t.showIcon,"show-line-number":t.showLineNumber,editable:t.editable,"editable-trigger":t.editableTrigger},null,8,["data","deep","show-double-quotes","show-line","show-length","show-icon","show-line-number","editable","editable-trigger"])]),_:1})}}});export{J as default};
|