rennzhang / codemirror-editor-vue3

CodeMirror component for Vue3
https://rennzhang.github.io/codemirror-editor-vue3
MIT License
202 stars 41 forks source link

placeholder设置响应式数据,视图上不变化 #15

Closed iaa3906 closed 2 years ago

iaa3906 commented 2 years ago

Describe the bug

我把placeholder当做属性传进来,子组件中我用watch监听打印出来确实变化了,但是视图上却没变化, <code-mirror v-model:value="code" :options="options" :placeholder="placeholder" :height="300" @change="onChange" /> const props = defineProps({ code: { default: '', type: String }, placeholder: { default: '', type: String } }) const code = toRef(props, 'code') const placeholder = toRef(props, 'placeholder') watch(placeholder, function (newVal, oldVal) { console.log(newVal, oldVal) }) 我改成直接用响应式数据不用props,也不行

Validations

rennzhang commented 2 years ago

fixed https://github.com/RennCheung/codemirror-editor-vue3/blob/main/CHANGELOG.md