04 2022 档案
摘要:项目中有一个表单提交的需求,表单内容样式较多,如果每个都写在同一个页面,那页面内容将会特别多 于是考虑到可拓展性 于是动手造轮子 根据相识度,将InputItem分成对应的几种类型 通过传参的方式显示不用的类型 InputItem组件中主要参数定义: type类型 取值范围:input | text
阅读全文
摘要:JavaScript中对时间格式化的工具类封装 export default { dateFormat(fmt, date) { let ret const opt = { 'y+': date.getFullYear().toString(), // 年 'M+': (date.getMonth(
阅读全文
摘要:正向传值 A页面向B页面传值 userInfo 为 Object {'name':'张三','sex':'男'} // 这里转换成 字符串 let navData = JSON.stringify(this.userInfo); console.log("字符串",navData); //跳转传值
阅读全文
摘要:通过prototype定义Vue实例的原型属性,使每个Vue实例中都可以用,又不会污染全局作用域。 toast.js const Toast = { //设置缓存(expire为缓存时效) show(title, icon = 'none', duration = 1500) { uni.showT
阅读全文