更新用户头像和表单字数限制
This commit is contained in:
@ -17,11 +17,11 @@
|
||||
label="标题:"
|
||||
:prop="`${props.vaildRules}.title`"
|
||||
:rules="[
|
||||
{ required: true, message: '20-50 字符,结构可用分类关键词+作品名/资源价值版本/使用场景', trigger: ['blur', 'change'] },
|
||||
{ required: true, message: '10-25 字符,结构可用分类关键词+作品名/资源价值版本/使用场景', trigger: ['blur', 'change'] },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value && value.length < 20) {
|
||||
callback(new Error('20-50 字符,结构可用分类关键词+作品名/资源价值版本/使用场景'))
|
||||
if (value && value.length < 10) {
|
||||
callback(new Error('10-25 字符,结构可用分类关键词+作品名/资源价值版本/使用场景'))
|
||||
}
|
||||
callback()
|
||||
},
|
||||
@ -29,7 +29,7 @@
|
||||
},
|
||||
]"
|
||||
>
|
||||
<el-input v-model="form.title" placeholder="20-50 字符,结构可用分类关键词+作品名/资源价值版本/使用场景" minlength="20" maxlength="50"></el-input>
|
||||
<el-input v-model="form.title" placeholder="10-25 字符,结构可用分类关键词+作品名/资源价值版本/使用场景" minlength="20" maxlength="50"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label-width="110px"
|
||||
@ -139,12 +139,12 @@
|
||||
label="作品描述:"
|
||||
:prop="`${props.vaildRules}.description`"
|
||||
:rules="[
|
||||
{ required: true, message: '简介字数限制60-150 字符,需包含用途、文件介绍、适用场景等', trigger: ['blur', 'change'] },
|
||||
{ required: true, message: '简介字数限制30-75 字符,需包含用途、文件介绍、适用场景等', trigger: ['blur', 'change'] },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
console.log(rule)
|
||||
if (value.length < 60) {
|
||||
callback(new Error('简介字数限制60-150 字符,需包含用途、文件介绍、适用场景等'))
|
||||
if (value.length < 30) {
|
||||
callback(new Error('简介字数限制30-75 字符,需包含用途、文件介绍、适用场景等'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
@ -153,7 +153,7 @@
|
||||
},
|
||||
]"
|
||||
>
|
||||
<el-input v-model="form.description" type="textarea" :rows="6" placeholder="简介字数限制60-150 字符,需包含用途、文件介绍、适用场景等" minlength="60" maxlength="150" show-word-limit></el-input>
|
||||
<el-input v-model="form.description" type="textarea" :rows="6" placeholder="简介字数限制30-75 字符,需包含用途、文件介绍、适用场景等" minlength="60" maxlength="150" show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user