Closed iaa3906 closed 2 years ago
我把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,也不行
fixed https://github.com/RennCheung/codemirror-editor-vue3/blob/main/CHANGELOG.md
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