index.wxs 556 B

12345678910111213141516171819202122232425
  1. /* eslint-disable */
  2. var style = require('../wxs/style.wxs');
  3. var addUnit = require('../wxs/add-unit.wxs');
  4. function wrapStyle(data) {
  5. return style({
  6. transform: data.transform
  7. ? 'translate3d(0, ' + data.transform + 'px, 0)'
  8. : '',
  9. top: data.fixed ? addUnit(data.offsetTop) : '',
  10. 'z-index': data.zIndex,
  11. });
  12. }
  13. function containerStyle(data) {
  14. return style({
  15. height: data.fixed ? addUnit(data.height) : '',
  16. 'z-index': data.zIndex,
  17. });
  18. }
  19. module.exports = {
  20. wrapStyle: wrapStyle,
  21. containerStyle: containerStyle,
  22. };