From db6d22f5b89d913b1ac0b613ac654ef874e5458a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 10 四月 2022 15:05:57 +0800 Subject: [PATCH] 2022-04-10 --- src/tabviews/custom/components/card/balcony/index.jsx | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index fb01441..c92528f 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -35,7 +35,7 @@ } UNSAFE_componentWillMount () { - const { data, BID } = this.props + const { data, BID, initdata } = this.props let _config = fromJS(this.props.config).toJS() let _data = { $$empty: true } @@ -50,6 +50,12 @@ _data = _data[0] || {} } _sync = false + } else if (_sync && initdata) { + _data = initdata + if (Array.isArray(_data)) { + _data = _data[0] || {$$empty: true} + } + _sync = false } } @@ -57,8 +63,8 @@ _data.$$BID = BID || '' } - if (_config.wrap.position === 'fixed') { - _config.style.position = 'fixed' + if (_config.wrap.position === 'fixed' || _config.wrap.position === 'absolute') { + _config.style.position = _config.wrap.position _config.style.zIndex = 2 _config.style.left = _config.wrap.left || '' _config.style.right = _config.wrap.right || '' @@ -66,6 +72,12 @@ _config.style.bottom = _config.wrap.bottom || '' _config.style.transform = _config.wrap.transform || '' _config.style.width = _config.wrap.realwidth || '' + } else { + _config.style.zIndex = 2 + _config.style.left = _config.wrap.left || '' + _config.style.right = _config.wrap.right || '' + _config.style.top = _config.wrap.top || '' + _config.style.bottom = _config.wrap.bottom || '' } let show = true -- Gitblit v1.8.0