v-bind="$attrs" 对v-model失效,获取不到v-model绑定的值,升级一下vue就好了。

<template>
  <quill-editor :options="editorOption" v-bind="$attrs" v-on="$listeners" ></quill-editor>
</template>

场景:封装vue-quill-editor组件,用了v-bind="$attrs"。但是,使用的时候v-model失效。几经捣鼓之后,怀疑是vue的版本低的问题,于是升级了一下vue和vue-template-compiler。顺利解决!

"vue": "^2.6.10",
"vue-template-compiler": "^2.6.10"

 

 

posted @ 2023-02-09 17:49  咖啡不用冲  阅读(23)  评论(0)    收藏  举报