diff --git a/packages/uni-components/src/helpers/component.ts b/packages/uni-components/src/helpers/component.ts index 4c54857d3cb317c99a71d1631bb69475aa990b4d..80dc9271defc96e01b594380926c53e3965e93e6 100644 --- a/packages/uni-components/src/helpers/component.ts +++ b/packages/uni-components/src/helpers/component.ts @@ -9,11 +9,10 @@ export const defineBuiltInComponent: typeof defineComponent = ( options: any ) => { // TODO 可能会补充特殊标记 - if (!options.props || typeof options.props.animation === 'undefined') { - // 补充内置组件animation - typeof options.mixins !== 'undefined' - ? options.mixins.push(animation) - : (options.mixins = [animation]) + const { props, mixins } = options + // 补充内置组件animation + if (!props || !props.animation) { + ;(mixins || (options.mixins = [])).push(animation) } return defineSystemComponent(options) } diff --git a/packages/uni-h5/dist/uni-h5.cjs.js b/packages/uni-h5/dist/uni-h5.cjs.js index bd929539eccbfc0b228a509430992754d52cf5d7..a204fe4bf6fb1561dcf3d1526db244329252ef64 100644 --- a/packages/uni-h5/dist/uni-h5.cjs.js +++ b/packages/uni-h5/dist/uni-h5.cjs.js @@ -1149,8 +1149,9 @@ var animation = { } }; const defineBuiltInComponent = (options) => { - if (!options.props || typeof options.props.animation === "undefined") { - typeof options.mixins !== "undefined" ? options.mixins.push(animation) : options.mixins = [animation]; + const {props: props2, mixins} = options; + if (!props2 || !props2.animation) { + (mixins || (options.mixins = [])).push(animation); } return defineSystemComponent(options); }; diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index a9cfeaa5a8231ffd9f205c34261bf5fd8b14c6ba..b32450580ff47a2320ad918aa576097f9610377b 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -485,7 +485,7 @@ var safeAreaInsets = { onChange, offChange }; -var D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out = safeAreaInsets; +var out = safeAreaInsets; const onEventPrevent = /* @__PURE__ */ withModifiers(() => { }, ["prevent"]); const onEventStop = /* @__PURE__ */ withModifiers(() => { @@ -497,10 +497,10 @@ function getWindowOffset() { const left = parseInt(style.getPropertyValue("--window-left")); const right = parseInt(style.getPropertyValue("--window-right")); return { - top: top ? top + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top : 0, - bottom: bottom ? bottom + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom : 0, - left: left ? left + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left : 0, - right: right ? right + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right : 0 + top: top ? top + out.top : 0, + bottom: bottom ? bottom + out.bottom : 0, + left: left ? left + out.left : 0, + right: right ? right + out.right : 0 }; } function updateCssVar(cssVars) { @@ -1190,7 +1190,7 @@ function normalizePageMeta(pageMeta) { let offset = rpx2px(refreshOptions.offset); const {type} = navigationBar; if (type !== "transparent" && type !== "none") { - offset += NAVBAR_HEIGHT + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top; + offset += NAVBAR_HEIGHT + out.top; } refreshOptions.offset = offset; refreshOptions.height = rpx2px(refreshOptions.height); @@ -2090,8 +2090,9 @@ var animation = { } }; const defineBuiltInComponent = (options) => { - if (!options.props || typeof options.props.animation === "undefined") { - typeof options.mixins !== "undefined" ? options.mixins.push(animation) : options.mixins = [animation]; + const {props: props2, mixins} = options; + if (!props2 || !props2.animation) { + (mixins || (options.mixins = [])).push(animation); } return defineSystemComponent(options); }; @@ -14916,7 +14917,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () const windowWidth = getWindowWidth(screenWidth); let windowHeight = window.innerHeight; const language = navigator.language; - const statusBarHeight = D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top; + const statusBarHeight = out.top; let osname; let osversion; let model; @@ -15029,12 +15030,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () const system = `${osname} ${osversion}`; const platform = osname.toLocaleLowerCase(); const safeArea = { - left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left, - right: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right, - top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top, - bottom: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom, - width: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right, - height: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom + left: out.left, + right: windowWidth - out.right, + top: out.top, + bottom: windowHeight - out.bottom, + width: windowWidth - out.left - out.right, + height: windowHeight - out.top - out.bottom }; const {top: windowTop, bottom: windowBottom} = getWindowOffset(); windowHeight -= windowTop; @@ -15054,10 +15055,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () model, safeArea, safeAreaInsets: { - top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top, - right: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right, - bottom: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom, - left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left + top: out.top, + right: out.right, + bottom: out.bottom, + left: out.left } }; });