QingWei-Li / vue-markdown-loader

📇 Convert Markdown file to Vue2.0 component.
704 stars 161 forks source link

组件emit的方法驼峰命名时,在md中使用无法监听到该事件 #60

Open xilibro opened 5 years ago

xilibro commented 5 years ago

<sr-table ref="myTable" :loading="loading" :data="dataList" @sortChange="change" :table-id="tableId">

sortChange: function ({ column, prop, order }) { this.$emit('sortChange', { column, prop, order }) },

改为sort-change ,才能正常监听到。 请问可以实现 驼峰命名的事件监听吗? 在 0.6.0版本好像解决过这个问题,但目前我这个版本依然不行 v2.4.1

[Vue tip]: Event "sortchange" is emitted in component at /src/table.vue but the handler is registered for "sortChange". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "sort-change" instead of "sortChange".

xilibro commented 5 years ago

好像是 cheerio 版本更新问题

https://github.com/cheeriojs/cheerio/issues/1096 但作者的答复并不能解决问题