@ahmttyydn/use-codemirror
CodeMirror Hook for Vue
Installation
npm install @ahmttyydn/use-codemirror
Usage
<script setup>
import { useCodeMirror } from '@ahmttyydn/use-codemirror'
import { ref } from 'vue'
const editor = ref(null)
const { codeMirror, setCodeMirrorContent } = useCodeMirror({
codeMirrorRef: editor,
content: '{ "foo": "bar" }',
language: 'json',
lineNumbers: true,
onChange: (value) => {
console.log('Content changed:', value)
},
})
</script>
<template>
<div ref="editor" />
</template>
Community
We are API nerds. You too? Let's chat on Discord: https://discord.gg/scalar
License
The source code in this repository is licensed under MIT.
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.9 | ^3.5.30 | MIT | |
| 1.0.8 | ^3.5.30 | MIT | |
| 1.0.6 | ^3.5.30 | MIT | |
| 1.0.4 | ^3.5.30 | MIT | |
| 1.0.2 | ^3.5.30 | MIT | |
| 1.0.1 | ^3.5.30 | MIT | |
| 1.0.0 | ^3.5.30 | MIT |