mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
import{S as c}from"./vue-json-pretty-CprP0Obx.js";import{d as m,r as w,n as l,b,e as f,w as o,f as a,u as g,g as d,j as n,h as u}from"./index-DMqaFtX4.js";const v={class:"card-header"},_={class:"font-medium"},x=m({name:"JsonEditor",__name:"json-editor",setup(k){const r={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(r),data:r,showLine:!0,showLineNumber:!0,showDoubleQuotes:!0,showLength:!0,editable:!0,showIcon:!0,editableTrigger:"click",deep:3});return l(()=>e.val,s=>{try{e.data=JSON.parse(s)}catch(t){}}),l(()=>e.data,s=>{try{e.val=JSON.stringify(s)}catch(t){}}),(s,t)=>{const i=u("el-link"),h=u("el-card");return f(),b(h,{shadow:"never"},{header:o(()=>[d("div",v,[d("span",_,[t[2]||(t[2]=n(" JSON编辑器,采用开源的 ")),a(i,{href:"https://github.com/leezng/vue-json-pretty",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:o(()=>t[1]||(t[1]=[n(" vue-json-pretty ")])),_:1}),t[3]||(t[3]=n(" (支持大数据量) "))])]),a(i,{class:"mt-2",href:"https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/json-editor.vue",target:"_blank"},{default:o(()=>t[4]||(t[4]=[n(" 代码位置 src/views/components/json-editor.vue ")])),_:1})]),default:o(()=>[a(g(c),{data:e.data,"onUpdate:data":t[0]||(t[0]=p=>e.data=p),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{x as default};
|