From 40c89d588ab7699072bdcc4d5104f76a545e09d0 Mon Sep 17 00:00:00 2001 From: ChenMou <1106417223@qq.com> Date: Sun, 18 Aug 2019 12:55:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(float-layout):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0top,=E7=B1=BB=E5=9E=8B=E4=B8=BABooolean,?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BAfalse,=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=B5=AE=E5=8A=A8=E5=BC=B9=E5=B1=82=E6=98=AF=E5=90=A6=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E5=BC=B9=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/float-layout/index.js | 7 +++++-- src/style/components/float-layout.scss | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/float-layout/index.js b/src/components/float-layout/index.js index e4b0debca..a4d8e1932 100644 --- a/src/components/float-layout/index.js +++ b/src/components/float-layout/index.js @@ -62,7 +62,8 @@ export default class AtFloatLayout extends AtComponent { scrollLeft, upperThreshold, lowerThreshold, - scrollWithAnimation + scrollWithAnimation, + top } = this.props const rootClass = classNames( @@ -76,7 +77,7 @@ export default class AtFloatLayout extends AtComponent { return ( - + {title ? ( {title} @@ -113,6 +114,7 @@ AtFloatLayout.defaultProps = { scrollY: true, scrollX: false, scrollWithAnimation: false, + top: false, onClose: () => {}, onScroll: () => {}, @@ -130,6 +132,7 @@ AtFloatLayout.propType = { upperThreshold: PropTypes.number, lowerThreshold: PropTypes.number, scrollWithAnimation: PropTypes.bool, + top: PropTypes.bool, onClose: PropTypes.func, onScroll: PropTypes.func, onScrollToLower: PropTypes.func, diff --git a/src/style/components/float-layout.scss b/src/style/components/float-layout.scss index 591aef463..74e1f57e0 100644 --- a/src/style/components/float-layout.scss +++ b/src/style/components/float-layout.scss @@ -30,6 +30,12 @@ $float-layout-timer: 300ms; background-color: $color-bg; transform: translate3d(0, 100%, 0); transition: transform $float-layout-timer cubic-bezier(0.36, 0.66, 0.04, 1); + + &--top { + top: 0; + bottom: auto; + transform: translate3d(0, -100%, 0); + } } .layout {