• 首页
  • 前端技术
  • 编程语言
  • 人工智能
  • 运维知识
  • 资源下载
  • 常用小工具
  • 技术问答

elementUI——el-form表单,校验二层对象的值

2021-07-11

搬运自: vue el-form 表单对象里还有对象,多层嵌套校验,制定校验规则_System.out.print的博客-CSDN博客

 

表单:

form:{
    name:'',
    role:{
        name:''     
    }
}

 

1、给 el-form-item 的 prop="" 设为:prop="role.name"

2、然后在校验规则中:重点要用 '' 括起来

rules: {
    'role.name': [
        {required: true, message: '请输入角色名', trigger: 'blur'},
    ]
}

 

相关文章:

猜你喜欢
相关资源
相似解决方案
热门标签
Java Python linux javascript Mysql C# Docker 算法 前端 SpringBoot Redis Vue spring 设计模式 .net core .net kubernetes c++ 数据库 数据结构 大数据 js 机器学习 微服务 Android Go 程序员 面试 JVM ASP.net core 云原生 人工智能 后端 PHP git CSS golang k8s Nginx Django mybatis 深度学习 多线程 React 架构 devops 爬虫 云计算 Spring Boot LeetCode
By © 2026 likecs 版权所有,
本站所有数据收集于网络如有侵犯到您的权益请联系 进行下架处理1。
粤ICP备22038628号Powered By WordPress