"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[2048],{24790:function(e,t,l){l.r(t),l.d(t,{default:function(){return p}});var a=l(66252);const n={style:{"margin-top":"15px"}},o=(0,a.Uk)("获取v-model"),s=(0,a.Uk)("getValue()"),r=(0,a.Uk)("setValue()");function u(e,t,l,u,d,i){const m=(0,a.up)("el-alert"),c=(0,a.up)("sc-code-editor"),p=(0,a.up)("el-button"),h=(0,a.up)("el-card"),g=(0,a.up)("el-col"),f=(0,a.up)("el-row"),w=(0,a.up)("el-main");return(0,a.wg)(),(0,a.j4)(w,null,{default:(0,a.w5)((()=>[(0,a.Wm)(m,{title:"感谢codeMirror组件",type:"success",style:{"margin-bottom":"20px"}}),(0,a.Wm)(f,{gutter:15},{default:(0,a.w5)((()=>[(0,a.Wm)(g,{lg:24},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{shadow:"never",header:"JSON"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{ref:"editor",modelValue:d.json,"onUpdate:modelValue":t[0]||(t[0]=e=>d.json=e),mode:"javascript",height:200},null,8,["modelValue"]),(0,a._)("div",n,[(0,a.Wm)(p,{type:"primary",onClick:i.getCode},{default:(0,a.w5)((()=>[o])),_:1},8,["onClick"]),(0,a.Wm)(p,{type:"primary",onClick:i.getValue},{default:(0,a.w5)((()=>[s])),_:1},8,["onClick"]),(0,a.Wm)(p,{type:"primary",onClick:i.setValue},{default:(0,a.w5)((()=>[r])),_:1},8,["onClick"])])])),_:1})])),_:1}),(0,a.Wm)(g,{lg:12},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{shadow:"never",header:"javascript Darcula主题"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.js,"onUpdate:modelValue":t[1]||(t[1]=e=>d.js=e),mode:"javascript",theme:"darcula"},null,8,["modelValue"])])),_:1})])),_:1}),(0,a.Wm)(g,{lg:12},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{shadow:"never",header:"SQL"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.sql,"onUpdate:modelValue":t[2]||(t[2]=e=>d.sql=e),mode:"sql"},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1})}const d=(0,a.RC)((()=>Promise.all([l.e(2528),l.e(6054),l.e(9163)]).then(l.bind(l,39163))));var i={name:"codeeditor",components:{scCodeEditor:d},data(){return{json:'{\n\t"name": "SCUI",\n\t"menu": [\n\t\t{\n\t\t\t"title": "VUE 3",\n\t\t\t"type": true,\n\t\t\t"link": "https://v3.cn.vuejs.org"\n\t\t},\n\t\t{\n\t\t\t"title": "elementplus",\n\t\t\t"type": false,\n\t\t\t"link": "https://element-plus.gitee.io"\n\t\t}\n\t]\n}',js:"// Demo code (the actual new parser character stream implementation)\nfunction StringStream(string) {\n\tthis.pos = 0;\n\tthis.string = string;\n}",sql:"SELECT `author`, `title` FROM `posts`\nWHERE `status` = 'draft' AND `author` IN('author1','author2')\nORDER BY `created_at` DESC, `id` DESC LIMIT 0, 10;"}},methods:{getCode(){this.$message("请查看控制台"),console.log(this.json)},getValue(){this.$message("请查看控制台");var e=this.$refs.editor.coder.getValue();console.log(e)},setValue(){var e='{"key":"newValue"}';this.$refs.editor.coder.setValue(e)}}},m=l(83744);const c=(0,m.Z)(i,[["render",u]]);var p=c}}]);