Skip to content

Commit

Permalink
feat(xgplayer): 增加下载按钮点击的hook;
Browse files Browse the repository at this point in the history
  • Loading branch information
hongqx committed Jul 19, 2023
1 parent 51af211 commit 15f1cf1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/xgplayer/src/plugins/download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ export default class Download extends IconPlugin {
return
}
this.appendChild('.xgplayer-icon', this.icons.download)
this.bind(['click', 'touchend'], this.download)
this._handler = this.hook('click', this.download, {
pre: (e) => {
e.preventDefault()
e.stopPropagation()
}
})
this.bind(['click', 'touchend'], this._handler)
}

registerIcons () {
Expand Down

0 comments on commit 15f1cf1

Please sign in to comment.