提交初始版本,使用vant ui库
This commit is contained in:
32
miniprogram_npm/@vant/weapp/grid-item/index.wxs
Normal file
32
miniprogram_npm/@vant/weapp/grid-item/index.wxs
Normal file
@@ -0,0 +1,32 @@
|
||||
/* eslint-disable */
|
||||
var style = require('../wxs/style.wxs');
|
||||
var addUnit = require('../wxs/add-unit.wxs');
|
||||
|
||||
function wrapperStyle(data) {
|
||||
var width = 100 / data.columnNum + '%';
|
||||
|
||||
return style({
|
||||
width: 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',
|
||||
})
|
||||
: '';
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
wrapperStyle: wrapperStyle,
|
||||
contentStyle: contentStyle,
|
||||
};
|
Reference in New Issue
Block a user