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