From 15f1cf1e993407a896fae84e715ec5c7b21e5664 Mon Sep 17 00:00:00 2001 From: hongqiongxing Date: Tue, 4 Jul 2023 19:38:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(xgplayer):=20=E5=A2=9E=E5=8A=A0=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E7=9A=84hook;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/xgplayer/src/plugins/download/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/xgplayer/src/plugins/download/index.js b/packages/xgplayer/src/plugins/download/index.js index d23fd9526..57af08a85 100644 --- a/packages/xgplayer/src/plugins/download/index.js +++ b/packages/xgplayer/src/plugins/download/index.js @@ -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 () {