1 changed files with 23 additions and 3 deletions
@ -1,8 +1,28 @@ |
|||
<template> |
|||
<w-codemirror v-model="value" lang="xml" style="height: 60px"></w-codemirror> |
|||
<!-- <w-codemirror |
|||
v-model="value" |
|||
lang="xml" |
|||
placeholder="Code goes here..." |
|||
:autofocus="false" |
|||
:tab-size="2" |
|||
:style="{ height: '200px', padding: '20px' }" |
|||
></w-codemirror> --> |
|||
<div ref="codemirrorRef"></div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { ref, onMounted, onUnmounted } from 'vue'; |
|||
import { EditorView, basicSetup } from 'codemirror'; |
|||
import { javascript } from '@codemirror/lang-javascript'; |
|||
|
|||
const value = ref('<xml><a name="name"></a>'); |
|||
const codemirrorRef = ref(); |
|||
|
|||
onMounted(() => { |
|||
let view = new EditorView({ |
|||
extensions: [basicSetup, javascript()], |
|||
parent: codemirrorRef.value, |
|||
}); |
|||
}); |
|||
|
|||
onUnmounted(() => {}); |
|||
const value = ref('<xml><a name="name"></a></xml>'); |
|||
</script> |
|||
|
Loading…
Reference in new issue