Skip to content

Commit e2ff035

Browse files
committed
feat:Multi lua window
1 parent 6edbd7f commit e2ff035

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

web/src/components/show/LuaView.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<el-row>
44
<el-col :span="15">
5-
<div ref="editor" id="codeEditBox"></div>
5+
<div ref="editor" :id="id" class="editor"></div>
66
</el-col>
77
<el-col :offset="1" :span="8">
88

@@ -59,14 +59,15 @@ export default {
5959
})
6060
6161
let result = ref("")
62+
let id = ref(props.sk+props.db+'lua')
6263
6364
let items = [1,1,1,1,1];
6465
6566
const content = ref("")
6667
const editor = ref(null)
6768
const initEditor = () => {
6869
// 初始化编辑器,确保dom已经渲染
69-
editor.value = monaco.editor.create(document.getElementById('codeEditBox'), {
70+
editor.value = monaco.editor.create(document.getElementById(id.value), {
7071
value: 'return redis.call("GET",KEYS[1])',
7172
language: 'lua',
7273
theme: 'vs-dark',
@@ -114,6 +115,7 @@ export default {
114115
})
115116
116117
return {
118+
id,
117119
items,
118120
result,
119121
luaForm,
@@ -124,7 +126,7 @@ export default {
124126
}
125127
</script>
126128
<style scoped>
127-
#codeEditBox {
129+
.editor {
128130
width:100%;
129131
height:400px;
130132
}

web/src/utils/lua.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { ElButton, ElCol, ElInput, ElRow } from 'element-plus';
55

66

77
const showLua = (id,sk,db)=>{
8-
console.log(sk)
9-
console.log(db)
108
const store = useStore()
119
const vdom = createApp({
1210
setup() {
@@ -16,7 +14,7 @@ const showLua = (id,sk,db)=>{
1614
LuaView,
1715
{
1816
sk:sk,
19-
db:db,
17+
db:db,
2018
},
2119
null
2220
)

0 commit comments

Comments
 (0)