Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify the editor value, modify the files editor content in the store is not synchronized, #145

Closed
ckvv opened this issue Aug 8, 2023 · 0 comments

Comments

@ckvv
Copy link

ckvv commented Aug 8, 2023

截屏2023-08-08 12 33 18

<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>

<style>
  .editor {
    min-height: 300px !important;
  }
</style>
@sxzz sxzz closed this as completed in 49fdc71 Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant