From 741d0d12376d1645538b709f210ac8c7d0a67a3a Mon Sep 17 00:00:00 2001 From: Yao Date: Sun, 21 Jan 2018 15:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20toptips=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98=20(#116)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/toptips/index.js | 4 ++-- packages/toptips/index.pcss | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/toptips/index.js b/packages/toptips/index.js index 279a874f..c1d1cea5 100644 --- a/packages/toptips/index.js +++ b/packages/toptips/index.js @@ -4,7 +4,7 @@ module.exports = { // 如果已经有一个计时器在了,就清理掉先 if (zanTopTips.timer) { clearTimeout(zanTopTips.timer); - zanTopTips.timer = -1; + zanTopTips.timer = 0; } if (typeof options === 'number') { @@ -22,7 +22,7 @@ module.exports = { let timer = setTimeout(() => { this.setData({ 'zanTopTips.show': false, - 'zanTopTips.timer': -1 + 'zanTopTips.timer': 0 }); }, options.duration); diff --git a/packages/toptips/index.pcss b/packages/toptips/index.pcss index 07c9a2fb..e391bf04 100644 --- a/packages/toptips/index.pcss +++ b/packages/toptips/index.pcss @@ -12,6 +12,7 @@ color: #FFF; background-color: #E64340; z-index: 110; + opacity: 0; /* 动画部分 */ transition: all 0.4s ease; @@ -19,4 +20,5 @@ .zan-toptips--show { -webkit-transform: translateZ(0) translateY(0); + opacity: 1; }