摘要:
参考连接:https://blog.csdn.net/qq_36451496/article/details/100163017 密码输入框的一些问题 1.js代码(有错) <input type="password" id="psw" name="Psw" onChange={this.handl 阅读全文
摘要:
uniapp page.json { "pages": [{ "path": "pages/index/index", "style": { "navigationBarTitleText": "首页" } }, { "path": "pages/message/message", "style": 阅读全文
摘要:
时间选择器 DatePicker 前言 最近做了需要用到时间选择器的项目,用到了DatePicker,特此来记录下 首先先贴出官网连接: ant Mobile:https://antd-mobile-doc-v2.gitee.io/components/date-picker-cn/ antd:ht 阅读全文
摘要:
去除数组中的空元素 record = record.filter(function(n){return n}) 阅读全文
摘要:
创建固定长度的空数组 let record= Array(3).fill('') 阅读全文
摘要:
修改数组的某个值 不要在原数组上改 如果只是简单的单纯数组,就用 slice 浅拷贝一下再改, 如果是对象数组,就用 let two_brand = one_brand.map(o ⇒ Object.assign({}, o)) 的方法 深刻拷贝一下再改。 用深拷贝或浅拷贝保证了元数据不变 浅拷贝代 阅读全文
摘要:
表单提交信息验证时机 1、表单修改的时候验证一次 2、表单提交的时候再次验证 代码(部分) constructor(options) { super(options); this.state = { WorkId: '',//工号 ValidateWorkId: { len: 6, validate 阅读全文
摘要:
时间相关 1.获取当前时间 const nowTimeStamp = Date.now();//1626058612777当前时间戳 const now = new Date(nowTimeStamp);//Mon Jul 12 2021 10:57:17 GMT+0800 (中国标准时间) {} 阅读全文
摘要:
#表单提交 代码片段 handlerSubmit = (e) => { e.preventDefault();//阻止表单提交 // 1.表单校验 this.validateName()&&this.validateMail()&&console.log(1) // 2.表单提交到后台的ajax请求 阅读全文
摘要:
测试邮箱格式 html react 部分代码 // 初始化数据 constructor(options) { super(options); this.state = { Mail: '',//邮箱 ValidateMail: { validate: true,//是否正确 msgWrong: '请 阅读全文
摘要:
表单获取输入值方法 代码节选 用name绑定 // 获取表单的值 并传给state handlerChange = (e) => { this.setState({ [e.target.name]: e.target.type 'checkbox' ? e.target.checked : e.ta 阅读全文
摘要:
#单选 html(react) 代码节选 constructor(options) { super(options); this.state = { IsAdmin: true } } <input type="checkBox" id="isAdmn" name="IsAdmin" onChang 阅读全文
摘要:
下拉框 一、html+react基础版 部分代码 // 初始化数据 constructor(options) { super(options); this.state = { Province: 1 } } // 获取表单的值 并传给state handlerChange = (e) => { th 阅读全文