Fixing code mirror mode reactivity.
This commit is contained in:
parent
64fa8055ce
commit
3c67a2205e
|
@ -17,6 +17,7 @@
|
||||||
},
|
},
|
||||||
Text: {
|
Text: {
|
||||||
name: "text/html",
|
name: "text/html",
|
||||||
|
json: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -40,11 +41,12 @@
|
||||||
let editor
|
let editor
|
||||||
|
|
||||||
// Keep editor up to date with value
|
// Keep editor up to date with value
|
||||||
|
$: editor?.setOption("mode", mode)
|
||||||
$: editor?.setValue(value || "")
|
$: editor?.setValue(value || "")
|
||||||
|
|
||||||
// Creates an instance of a code mirror editor
|
// Creates an instance of a code mirror editor
|
||||||
async function createEditor(mode, value) {
|
async function createEditor(mode, value) {
|
||||||
if (!CodeMirror || !textarea || editor) {
|
if (!CodeMirror || !textarea) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue