Skip to content

Commit

Permalink
fix(notifier): use onClick instead of onclick
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 18, 2024
1 parent bd9adef commit 955fc81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions plugins/notifier/client/config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ const render: FunctionalComponent<{ children: segment[] }> = ({ children }, ctx)
} else if (type === 'button') {
return h(resolveComponent('el-button'), {
...attrs,
onclick: undefined,
onClick: () => send('notifier/button', attrs.onclick),
onClick: () => send('notifier/button', attrs.onClick),
}, {
default: () => render({ children }, ctx),
})
Expand Down
2 changes: 1 addition & 1 deletion plugins/notifier/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@koishijs/plugin-notifier",
"description": "Notifier service for Koishi",
"version": "1.1.1",
"version": "1.1.2",
"main": "lib/index.cjs",
"types": "lib/index.d.ts",
"exports": {
Expand Down
6 changes: 3 additions & 3 deletions plugins/notifier/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export class Notifier {
? [h('p', options.content)]
: h.toElementArray(options.content)
options.content = h.transform(content, ({ type, attrs }) => {
if (type === 'button' && typeof attrs.onclick === 'function') {
if (type === 'button' && typeof attrs.onClick === 'function') {
const key = Math.random().toString(36).slice(2)
this.ctx.notifier.actions[key] = attrs.onclick
this.ctx.notifier.actions[key] = attrs.onClick
this.actionKeys.push(key)
attrs.onclick = key
attrs.onClick = key
}
return true
})
Expand Down

0 comments on commit 955fc81

Please sign in to comment.