easy3wui 1.5.46-beta4 → 1.5.46-beta6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,14 +56,17 @@ var Easy3wGridTextArea = function (_Component) {
|
|
|
56
56
|
|
|
57
57
|
var textarea = document.getElementById(fieldId);
|
|
58
58
|
if (textarea) {
|
|
59
|
+
var scrollHeight = textarea.scrollHeight;
|
|
60
|
+
|
|
61
|
+
var scrollHeightNew = scrollHeight + 2;
|
|
59
62
|
// 监听输入事件
|
|
60
63
|
textarea.addEventListener('input', function () {
|
|
61
64
|
// 移除滚动条,以便正确计算内容高度
|
|
62
65
|
this.style.height = 'auto';
|
|
63
|
-
this.style.height =
|
|
66
|
+
this.style.height = scrollHeightNew + 'px';
|
|
64
67
|
});
|
|
65
68
|
// 初始时设置一次高度,确保页面加载时textarea高度正确
|
|
66
|
-
textarea.style.height =
|
|
69
|
+
textarea.style.height = scrollHeightNew + 'px';
|
|
67
70
|
}
|
|
68
71
|
}, _this.touchTransform = function (value) {
|
|
69
72
|
var strValue = value;
|
|
@@ -87,8 +90,8 @@ var Easy3wGridTextArea = function (_Component) {
|
|
|
87
90
|
form = _props.form,
|
|
88
91
|
required = _props.required,
|
|
89
92
|
requiredMessage = _props.requiredMessage,
|
|
90
|
-
label = _props.label
|
|
91
|
-
|
|
93
|
+
label = _props.label,
|
|
94
|
+
cmptPros = _props.cmptPros;
|
|
92
95
|
var getFieldDecorator = form.getFieldDecorator;
|
|
93
96
|
|
|
94
97
|
var _ref = cmptPros || {},
|
|
@@ -97,9 +100,9 @@ var Easy3wGridTextArea = function (_Component) {
|
|
|
97
100
|
rows = _ref.rows;
|
|
98
101
|
|
|
99
102
|
var defaultMaxLength = 2000;
|
|
100
|
-
if (!rows) {
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
+
// if (!rows) {
|
|
104
|
+
// cmptPros = { autosize: { minRows: 2, maxRows: 9999 }, ...cmptPros };
|
|
105
|
+
// }
|
|
103
106
|
var rules = [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }, { max: maxLength || defaultMaxLength, message: '\u5F55\u5165\u6587\u5B57\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7' + (maxLength || defaultMaxLength), transform: this.touchTransform }];
|
|
104
107
|
if (disabled) {
|
|
105
108
|
rules.pop();
|