Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xilibro opened this issue Jan 23, 2019 · 1 comment

Comments

@xilibro
Copy link

xilibro commented Jan 23, 2019

<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
Copy link
Author

xilibro commented Jan 23, 2019

好像是 cheerio 版本更新问题

cheeriojs/cheerio#1096
但作者的答复并不能解决问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant