mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-20 21:49:14 +08:00
refactor(sticky): shorten wxs code (#3899)
This commit is contained in:
parent
5626547a19
commit
ed0626fa89
@ -1,19 +1,20 @@
|
||||
/* eslint-disable */
|
||||
var style = require('../wxs/style.wxs');
|
||||
var addUnit = require('../wxs/add-unit.wxs');
|
||||
|
||||
function wrapStyle(data) {
|
||||
return style({
|
||||
transform: data.transform
|
||||
? 'translate3d(0, ' + data.transform + 'px, 0)'
|
||||
: '',
|
||||
top: data.fixed ? data.offsetTop + 'px' : '',
|
||||
top: data.fixed ? addUnit(data.offsetTop) : '',
|
||||
'z-index': data.zIndex,
|
||||
});
|
||||
}
|
||||
|
||||
function containerStyle(data) {
|
||||
return style({
|
||||
height: data.fixed ? data.height + 'px' : '',
|
||||
height: data.fixed ? addUnit(data.height) : '',
|
||||
'z-index': data.zIndex,
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user