Closed ckvv closed 1 year ago
<!-- TestEditor --> <script setup> import '@vue/repl/style.css'; import { Repl, ReplStore } from '@vue/repl'; import Monaco from '@vue/repl/monaco-editor'; import { ref, watch } from 'vue'; const code = ref(`<template>11</template>`) const store = new ReplStore(); watch(code, (v) => { store.setFiles({'src/App.vue': v}) }, { immediate: true }); </script> <template> <div> <input type="text" v-model="code"> <Repl :editor="Monaco" :store="store" :clear-console="false" /> </div> </template>
<template> <div> <TestEditor /> <TestEditor /> </div> </template>
monaco manages all files in one context and it is by designed, which means the same Uri of file will result in one identical model. You may try different file paths
monaco
Uri