UNPKG

press-ui

Version:

简单、易用的跨端组件库,兼容 Vue2 和 Vue3,同时支持 uni-app和普通 Vue 项目

33 lines (28 loc) 676 B
import { style } from '../common/utils/style'; import { addUnit } from '../common/utils/add-unit'; function wrapperStyle(data) { const width = `${100 / data.columnNum}%`; return style({ width, 'padding-top': data.square ? width : null, 'padding-right': addUnit(data.gutter), 'margin-top': data.index >= data.columnNum && !data.square ? addUnit(data.gutter) : null, }); } function contentStyle(data) { return data.square ? style({ right: addUnit(data.gutter), bottom: addUnit(data.gutter), height: 'auto', position: 'absolute', }) : ''; } export default { wrapperStyle, contentStyle, };