mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 07:10:27 +08:00
优化界面
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
let sourceCodeBoxIndex = 0
|
||||
|
||||
Vue.component("source-code-box", {
|
||||
props: ["name", "type", "id", "read-only", "width", "height"],
|
||||
props: ["name", "type", "id", "read-only", "width", "height", "focus"],
|
||||
mounted: function () {
|
||||
let readOnly = this.readOnly
|
||||
if (typeof readOnly != "boolean") {
|
||||
@@ -53,6 +53,10 @@ Vue.component("source-code-box", {
|
||||
})
|
||||
boxEditor.setValue(value)
|
||||
|
||||
if (this.focus) {
|
||||
boxEditor.focus()
|
||||
}
|
||||
|
||||
let width = this.width
|
||||
let height = this.height
|
||||
if (width != null && height != null) {
|
||||
@@ -64,6 +68,11 @@ Vue.component("source-code-box", {
|
||||
}
|
||||
boxEditor.setSize(width, height)
|
||||
}
|
||||
} else if (height != null) {
|
||||
height = parseInt(height)
|
||||
if (!isNaN(height)) {
|
||||
boxEditor.setSize("100%", height)
|
||||
}
|
||||
}
|
||||
|
||||
let info = CodeMirror.findModeByMIME(this.type)
|
||||
|
||||
Reference in New Issue
Block a user