部分多行文本框添加字数限制

This commit is contained in:
Jason 2022-09-19 15:20:43 +08:00
parent ccd4747203
commit 56da1c18dd
9 changed files with 39 additions and 19 deletions

View File

@ -18,6 +18,10 @@
<el-input
v-model="formData.title"
placeholder="请输入文章标题"
type="textarea"
:autosize="{ minRows: 3, maxRows: 6 }"
maxlength="200"
show-word-limit
clearable
/>
</div>
@ -42,6 +46,10 @@
<el-input
v-model="formData.intro"
placeholder="请输入文章简介"
type="textarea"
:autosize="{ minRows: 3, maxRows: 6 }"
:maxlength="200"
show-word-limit
clearable
/>
</div>
@ -50,8 +58,10 @@
<div class="w-80">
<el-input
type="textarea"
:rows="6"
:autosize="{ minRows: 6, maxRows: 6 }"
v-model="formData.summary"
maxlength="200"
show-word-limit
clearable
/>
</div>

View File

@ -56,6 +56,8 @@
v-model="formData.content"
:autosize="{ minRows: 4, maxRows: 4 }"
type="textarea"
maxlength="200"
show-word-limit
placeholder="请输入回复内容"
/>
</div>

View File

@ -52,7 +52,9 @@
v-model="formData.base.remarks"
class="el-input"
type="textarea"
:rows="4"
:autosize="{ minRows: 4, maxRows: 4 }"
maxlength="200"
show-word-limit
/>
</div>
</el-form-item>

View File

@ -37,7 +37,7 @@
<div class="w-full max-w-[320px]">
<el-input
type="textarea"
:rows="6"
:autosize="{ minRows: 6, maxRows: 6 }"
v-model="formData.smsNotice.content"
/>
</div>

View File

@ -71,7 +71,7 @@ const formData = reactive({
})
const checkMobile = (rule: any, value: any, callback: any) => {
if (!value) {
return callback(new Error('手机号不能为空'))
callback()
} else {
const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
console.log(reg.test(value))
@ -97,19 +97,7 @@ const formRules = {
trigger: ['blur']
}
],
duty: [
{
required: true,
message: '请输入负责人姓名',
trigger: ['blur']
}
],
mobile: [
{
required: true,
message: '请输入联系电话',
trigger: ['blur']
},
{
validator: checkMobile,
trigger: ['blur']

View File

@ -27,6 +27,8 @@
placeholder="请输入备注"
type="textarea"
:autosize="{ minRows: 4, maxRows: 6 }"
maxlength="200"
show-word-limit
/>
</el-form-item>
<el-form-item label="岗位状态" prop="isStop">

View File

@ -27,8 +27,10 @@
<el-input
v-model="formData.remark"
type="textarea"
:rows="4"
:autosize="{ minRows: 4, maxRows: 6 }"
placeholder="请输入备注"
maxlength="200"
show-word-limit
/>
</el-form-item>
<el-form-item label="排序" prop="sort">

View File

@ -42,7 +42,14 @@
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" type="textarea" rows="4" clearable />
<el-input
v-model="formData.remark"
type="textarea"
:autosize="{ minRows: 4, maxRows: 6 }"
clearable
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form>
</popup>

View File

@ -28,7 +28,14 @@
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="dictRemark">
<el-input v-model="formData.dictRemark" type="textarea" rows="4" clearable />
<el-input
v-model="formData.dictRemark"
type="textarea"
:autosize="{ minRows: 4, maxRows: 6 }"
clearable
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form>
</popup>