Skip to content

Commit

Permalink
fix(Message): resolved duration-end event is invalid (#3051)
Browse files Browse the repository at this point in the history
* fix(Message): resolved duration-end event is invalid

* fix(Message): resolved duration-end event is invalid
  • Loading branch information
jarmywang authored Aug 6, 2024
1 parent 6796ae4 commit df2e357
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/message/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`message props : style && customStyle 1`] = `
<t-message-item
id="t-message"
bind:close-btn-click="handleClose"
bind:duration-end="handleDurationEnd"
bind:link-click="handleLinkClick"
>
<wx-view
Expand Down
4 changes: 4 additions & 0 deletions src/message/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,8 @@ export default class Message extends SuperComponent {
handleLinkClick() {
this.triggerEvent('link-click');
}

handleDurationEnd() {
this.triggerEvent('duration-end');
}
}
7 changes: 6 additions & 1 deletion src/message/message.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<block wx:for="{{messageList}}" wx:key="id">
<t-message-item id="{{item.id}}" bind:close-btn-click="handleClose" bind:link-click="handleLinkClick">
<t-message-item
id="{{item.id}}"
bind:close-btn-click="handleClose"
bind:link-click="handleLinkClick"
bind:duration-end="handleDurationEnd"
>
<slot name="icon" slot="icon" />
<slot name="content" slot="content" />
<slot />
Expand Down

0 comments on commit df2e357

Please sign in to comment.