@scalar/use-codemirror
TypeScript icon, indicating that this package has built-in type declarations

0.11.99 • Public • Published

CodeMirror Hook for Vue

Version Downloads License Discord

Installation

npm install @scalar/use-codemirror

Usage

<script setup>
import { useCodeMirror } from '@scalar/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.

Package Sidebar

Install

npm i @scalar/use-codemirror

Weekly Downloads

41,576

Version

0.11.99

License

MIT

Unpacked Size

52.5 kB

Total Files

27

Last publish

Collaborators

  • amritkahlon
  • cameronrohani
  • marclave
  • tommastro
  • scalar_geoff
  • hwkr
  • mason-little
  • hanspagel