Commit 7a1aa88c by Lin

style:文本域禁止空格换行

1 parent 0498b34b
......@@ -268,12 +268,16 @@ Page({
},
/**
* Textarea 输入处理(带字数统计)
* Textarea 输入处理(带字数统计)- 禁止空格和换行
*/
handleTextareaInput(e) {
const { field } = e.currentTarget.dataset
const { value } = e.detail
let value = e.detail.value
const { formData } = this.data
// 过滤掉空格和换行符
value = value.replace(/[\s\r\n]/g, '')
formData[field] = value
formData[field + 'Length'] = value.length // 统计字数
this.setData({
......
......@@ -236,11 +236,15 @@ Page({
formList
});
},
// textarea输入变化
// textarea输入变化,禁止空格和换行
onTextareaInput(e) {
const index = e.currentTarget.dataset.index;
const value = e.detail.value;
let value = e.detail.value;
const formList = this.data.formList;
// 过滤掉空格和换行符
value = value.replace(/[\s\r\n]/g, '');
// 更新对应项的值
formList[index].value = value;
formList[index].displayValue = value;
......
......@@ -287,12 +287,3 @@ page {
background-color: #1989fa;
color: #fff;
}
/* 自定义对话框样式 */
.custom-dialog {
height: 364px !important;
}
.custom-dialog .van-dialog {
height: 364px !important;
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!