Closed LavaYasha closed 5 months ago
version 1.2.3
<template> <div> <CodeMirror ref="cm" :model-value="code" @update:model-value="updateCode" basic dark :lang="lang" ></CodeMirror> </div> </template> <script setup lang="ts"> import {onMounted, Ref, ref} from "vue"; import CodeMirror from "vue-codemirror6"; import { LanguageSupport } from '@codemirror/language' import { sql, PostgreSQL } from "@codemirror/lang-sql"; const props = defineProps<{ source?: string, tables?: { columns: string[] }[], }>() const cm = ref() const code: Ref<string>= ref('') const updateCode = (val: string) => { console.log('value from @update:model-value: ', val) code.value = val } const lang: LanguageSupport = sql({ dialect: PostgreSQL, schema: { tableTest: ['col1', 'col2'] } }) </script> <style scoped lang="scss"></style>
Fixed in 1.2.5.
Thanks, this resolved the issue.
version 1.2.3