vue-markdown-loader icon indicating copy to clipboard operation
vue-markdown-loader copied to clipboard

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

Open xilibro opened this issue 6 years ago • 1 comments

<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 <SrTable> 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 avatar Jan 23 '19 02:01 xilibro

好像是 cheerio 版本更新问题

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

xilibro avatar Jan 23 '19 04:01 xilibro