black a5a558eff3 新增Vant WeApp 组件库
- 添加 Vant WeApp 组件库的多个组件和工具文件
- 新增的组件包括 calendar、circle、collapse、dialog 等- 添加了常用的工具函数和样式文件
- 在 app.js 中集成了 Vant WeApp 组件库
2025-07-18 18:46:14 +08:00

37 lines
868 B
XML

/* eslint-disable */
var style = require('../wxs/style.wxs');
var addUnit = require('../wxs/add-unit.wxs');
function isObj(x) {
var type = typeof x;
return x !== null && (type === 'object' || type === 'function');
}
function optionText(option, valueKey) {
return isObj(option) && option[valueKey] != null ? option[valueKey] : option;
}
function rootStyle(data) {
return style({
height: addUnit(data.itemHeight * data.visibleItemCount),
});
}
function wrapperStyle(data) {
var offset = addUnit(
data.offset + (data.itemHeight * (data.visibleItemCount - 1)) / 2
);
return style({
transition: 'transform ' + data.duration + 'ms',
'line-height': addUnit(data.itemHeight),
transform: 'translate3d(0, ' + offset + ', 0)',
});
}
module.exports = {
optionText: optionText,
rootStyle: rootStyle,
wrapperStyle: wrapperStyle,
};