diff --git a/plugins/notifier/client/config.vue b/plugins/notifier/client/config.vue index 1e7ab005..59b20778 100644 --- a/plugins/notifier/client/config.vue +++ b/plugins/notifier/client/config.vue @@ -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), }) diff --git a/plugins/notifier/package.json b/plugins/notifier/package.json index 11a9d3a5..09938c23 100644 --- a/plugins/notifier/package.json +++ b/plugins/notifier/package.json @@ -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": { diff --git a/plugins/notifier/src/index.ts b/plugins/notifier/src/index.ts index 934c8a23..afe24cab 100644 --- a/plugins/notifier/src/index.ts +++ b/plugins/notifier/src/index.ts @@ -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 })