From 69c83bc5397a68297bf4b56a4a610f34d2904f5b Mon Sep 17 00:00:00 2001 From: rex Date: Tue, 26 Nov 2019 20:28:45 +0800 Subject: [PATCH] fix(Notify): safe-area not work in android (#2393) fix #2372 --- packages/notify/index.less | 5 ----- packages/notify/index.ts | 5 +++++ packages/notify/notify.ts | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/notify/index.less b/packages/notify/index.less index 8ecac97d..ca640b6f 100644 --- a/packages/notify/index.less +++ b/packages/notify/index.less @@ -15,11 +15,6 @@ width: 100%; } - &__safe-area { - height: constant(safe-area-inset-top); - height: env(safe-area-inset-top); - } - &--primary { .theme(background-color, '@notify-primary-background-color'); } diff --git a/packages/notify/index.ts b/packages/notify/index.ts index aab98973..b0eac383 100644 --- a/packages/notify/index.ts +++ b/packages/notify/index.ts @@ -29,6 +29,11 @@ VantComponent({ } }, + created() { + const { statusBarHeight } = wx.getSystemInfoSync(); + this.setData({ statusBarHeight }); + }, + methods: { show() { const { duration, onOpened } = this.data; diff --git a/packages/notify/notify.ts b/packages/notify/notify.ts index 7aad3f8f..071fa2f8 100644 --- a/packages/notify/notify.ts +++ b/packages/notify/notify.ts @@ -23,7 +23,6 @@ const defaultOptions = { duration: 3000, zIndex: 110, color: WHITE, - safeAreaInsetTop: false, onClick: () => {}, onOpened: () => {}, onClose: () => {}