From e9fa8d402ed68e6c6d94e4c7e2b4fdf6683e5c61 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 22 Apr 2021 21:28:08 +0800 Subject: [PATCH] feat: make event tree-shakeable --- packages/uni-core/src/helpers/event.ts | 6 ++++-- packages/uni-h5/dist/uni-h5.esm.js | 10 ++++++---- packages/uni-h5/src/service/api/ui/popup/utils.ts | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/uni-core/src/helpers/event.ts b/packages/uni-core/src/helpers/event.ts index 3f6b3cb6c6..53ad996ab5 100644 --- a/packages/uni-core/src/helpers/event.ts +++ b/packages/uni-core/src/helpers/event.ts @@ -1,3 +1,5 @@ import { withModifiers } from 'vue' -export const onTouchmovePrevent = withModifiers(() => {}, ['prevent']) -export const onTouchmoveStop = withModifiers(() => {}, ['stop']) +export const onTouchmovePrevent = /*#__PURE__*/ withModifiers(() => {}, [ + 'prevent', +]) +export const onTouchmoveStop = /*#__PURE__*/ withModifiers(() => {}, ['stop']) diff --git a/packages/uni-h5/dist/uni-h5.esm.js b/packages/uni-h5/dist/uni-h5.esm.js index e5db18b0a2..55d3a1b4eb 100644 --- a/packages/uni-h5/dist/uni-h5.esm.js +++ b/packages/uni-h5/dist/uni-h5.esm.js @@ -1064,9 +1064,11 @@ function createSvgIconVNode(path, color = "#000", size = 27) { }, null, 8, ["d", "fill"]) ], 8, ["width", "height"]); } -const onTouchmovePrevent = withModifiers(() => { -}, ["prevent"]); -const onTouchmoveStop = withModifiers(() => { +const onTouchmovePrevent = /* @__PURE__ */ withModifiers(() => { +}, [ + "prevent" +]); +const onTouchmoveStop = /* @__PURE__ */ withModifiers(() => { }, ["stop"]); function disableScrollListener(evt) { evt.preventDefault(); @@ -12761,9 +12763,9 @@ function useKeyboard() { } const VNODE_MASK = /* @__PURE__ */ createVNode("div", {class: "uni-mask"}, null, -1); function createRootApp(component, rootState, callback) { + const onClose = (...args) => (rootState.visible = false, callback.apply(null, args)); return createApp(defineComponent({ setup() { - const onClose = (...args) => (rootState.visible = false, callback.apply(null, args)); return () => (openBlock(), createBlock(component, mergeProps({ onClose }, rootState))); diff --git a/packages/uni-h5/src/service/api/ui/popup/utils.ts b/packages/uni-h5/src/service/api/ui/popup/utils.ts index e391b290db..4e2bbffe95 100644 --- a/packages/uni-h5/src/service/api/ui/popup/utils.ts +++ b/packages/uni-h5/src/service/api/ui/popup/utils.ts @@ -25,12 +25,12 @@ export function createRootApp( rootState: Record, callback: (...args: any[]) => void ) { + const onClose = (...args: any[]) => ( + (rootState.visible = false), callback.apply(null, args) + ) return createApp( defineComponent({ setup() { - const onClose = (...args: any[]) => ( - (rootState.visible = false), callback.apply(null, args) - ) return () => ( openBlock(), createBlock( -- GitLab