Skip to content

Commit 06814e6

Browse files
committed
refactor: rename event from handleAction to actions in ChatActionbar component
1 parent 3789dc8 commit 06814e6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/pro-components/chat/chat-actionbar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ placement | String | start | 操作栏位置。可选项:start/end/space-aroun
5252

5353
名称 | 参数 | 描述
5454
-- | -- | --
55-
handleAction | `(name: ChatActionsName, context: { e: MouseEvent, active: boolean })` 点击点赞,点踩,复制,分享,重新生成按钮时触发发
55+
actions | `(name: ChatActionsName, context: { e: MouseEvent, active: boolean })` 点击点赞,点踩,复制,分享,重新生成按钮时触发发
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<t-toast id="t-toast" />
22
<view class="container">
3-
<t-chat-actionbar content="{{content}}" bind:handleAction="handleAction" />
3+
<t-chat-actionbar content="{{content}}" bind:actions="handleAction" />
44
</view>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<t-toast id="t-toast" />
22
<view class="container">
3-
<t-chat-actionbar content="{{content}}" bind:handleAction="handleAction" comment="{{comment}}" />
3+
<t-chat-actionbar content="{{content}}" bind:actions="handleAction" comment="{{comment}}" />
44
</view>

packages/pro-components/chat/chat-actionbar/chat-actionbar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default class ChatActionbar extends SuperComponent {
116116
this.setData({
117117
pComment: isActive ? undefined : 'good',
118118
});
119-
this.triggerEvent('handleAction', {
119+
this.triggerEvent('actions', {
120120
name,
121121
active: !isActive,
122122
});
@@ -125,12 +125,12 @@ export default class ChatActionbar extends SuperComponent {
125125
this.setData({
126126
pComment: isActive ? undefined : 'bad',
127127
});
128-
this.triggerEvent('handleAction', {
128+
this.triggerEvent('actions', {
129129
name,
130130
active: !isActive,
131131
});
132132
} else {
133-
this.triggerEvent('handleAction', {
133+
this.triggerEvent('actions', {
134134
name,
135135
});
136136
}
@@ -140,7 +140,7 @@ export default class ChatActionbar extends SuperComponent {
140140
if (!this.data.content) return;
141141
const copyContent =
142142
this.data.copyMode === 'markdown' ? this.data.content : this.data.filterSpecialChars(this.data.content);
143-
this.triggerEvent('handleAction', {
143+
this.triggerEvent('actions', {
144144
name: 'copy',
145145
data: copyContent,
146146
});

0 commit comments

Comments
 (0)