mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-11-06 14:02:09 +08:00
refactor(field): shorten wxs code (#3898)
This commit is contained in:
parent
ed0626fa89
commit
7e8f5bbb1c
@ -1,21 +1,18 @@
|
||||
/* eslint-disable */
|
||||
var utils = require('../wxs/utils.wxs');
|
||||
var style = require('../wxs/style.wxs');
|
||||
var addUnit = require('../wxs/add-unit.wxs');
|
||||
|
||||
function inputStyle(autosize) {
|
||||
if (autosize && autosize.constructor === 'Object') {
|
||||
var style = '';
|
||||
if (autosize.minHeight) {
|
||||
style += 'min-height:' + utils.addUnit(autosize.minHeight) + ';';
|
||||
}
|
||||
if (autosize.maxHeight) {
|
||||
style += 'max-height:' + utils.addUnit(autosize.maxHeight) + ';';
|
||||
}
|
||||
return style;
|
||||
return style({
|
||||
'min-height': addUnit(autosize.minHeight),
|
||||
'max-height': addUnit(autosize.maxHeight),
|
||||
});
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
inputStyle: inputStyle
|
||||
inputStyle: inputStyle,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user