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

when change the input value, the doc of state does not update #204

Open
4 tasks done
GongJS opened this issue Jul 5, 2023 · 0 comments
Open
4 tasks done

when change the input value, the doc of state does not update #204

GongJS opened this issue Jul 5, 2023 · 0 comments

Comments

@GongJS
Copy link

GongJS commented Jul 5, 2023

Describe the bug

this is my code:

<button @click="changeCode">change</button>
<Codemirror
      v-model="code"
      :indent-with-tab="true"
      :tab-size="2"
      @ready="handleReady"
/>

const code = ref('{}')
const state = ref()

const handleReady = (payload) => {
    state.value = payload.state
    console.log( state.value.doc)
}

const changeCode = () => {
    code.value = '{"a": "1"}'
    console.log(state.value.doc)
   // state.value.doc dose not change
}


### Reproduction

if need, i will provide

### System Info

```shell
"vue-codemirror": "^6.1.1"

Used Package Manager

pnpm

Validations

  • Read the the documentation in detail.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
  • The provided reproduction is a minimal reproducible example of the bug.
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