摘要: 1、手机号验证 // 验证手机号 export function checkPhone(rule, value, callback) { if (!value) { return callback(new Error('手机号不能为空')) } else { const reg = /^1[3|4| 阅读全文
posted @ 2022-03-18 14:50 DeyouKong 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 传统注册组件 1、在 src/components 下自定义公用组件 <template> <el-pagination :current-page="currentPage" :page-sizes="pageSizesComputed" :page-size="pageSize" layout= 阅读全文
posted @ 2022-03-18 14:47 DeyouKong 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 传统注册过滤器 1、先在 filters/index.js 文件中导出方法 /** * * @param {*} date * @returns */ export function dateTimeFormat(date) { const json_date = new Date(date).to 阅读全文
posted @ 2022-03-18 14:26 DeyouKong 阅读(683) 评论(0) 推荐(0) 编辑
摘要: 1、计算某个日期距当前时间多少分钟/时/天 /** * @param {number} time */ export function timeAgo(time) { const between = Date.now() / 1000 - Number(time) if (between < 360 阅读全文
posted @ 2022-03-18 14:06 DeyouKong 阅读(35) 评论(0) 推荐(0) 编辑