摘要:
结果:设置文字不换行,溢出后隐藏,截断显示省略符 .ellipsis { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } 结果:-webkit-line-clamp 可以把块容器中的内容限制为指定的行数为截断显示省略 阅读全文
posted @ 2022-05-26 23:00
前端搬运工bug
阅读(44)
评论(0)
推荐(0)
摘要:
结果: /** * * @param {*} formater 时间格式 * @param {*} time 自定时间,默认当前时间 * @returns */ const dateFormater = (formater, time) => { let date = time ? new Date 阅读全文
posted @ 2022-05-26 22:54
前端搬运工bug
阅读(34)
评论(0)
推荐(0)
摘要:
结果: const nowTime = () => { const now = new Date(); const year = now.getFullYear(); const month = now.getMonth(); const date = now.getDate() >= 10 ? n 阅读全文
posted @ 2022-05-26 22:49
前端搬运工bug
阅读(33)
评论(0)
推荐(0)
摘要:
const getExplorerInfo = () => { let t = navigator.userAgent.toLowerCase(); return 0 <= t.indexOf("msie") ? { //ie < 11 type: "IE", version: Number(t.m 阅读全文
posted @ 2022-05-26 22:45
前端搬运工bug
阅读(63)
评论(0)
推荐(0)
摘要:
const broswer = () => { const ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return "weixin"; } else i 阅读全文
posted @ 2022-05-26 22:44
前端搬运工bug
阅读(101)
评论(0)
推荐(0)
摘要:
结果: /** * * @param {*} value 身份证 * @returns */ const checkCardNo = (value) => { let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; return reg.test( 阅读全文
posted @ 2022-05-26 22:41
前端搬运工bug
阅读(29)
评论(0)
推荐(0)
摘要:
结果: /** * * @param {*} value 数字 * @returns */ const intToChinese = (value) => { const str = String(value); const len = str.length-1; const idxs = ['', 阅读全文
posted @ 2022-05-26 22:37
前端搬运工bug
阅读(136)
评论(0)
推荐(0)
摘要:
结果: /** * * @param {*} n 数字 * @returns */ const digitUppercase = (n) => { const fraction = ['角', '分']; const digit = [ '零', '壹', '贰', '叁', '肆', '伍', ' 阅读全文
posted @ 2022-05-26 22:35
前端搬运工bug
阅读(29)
评论(0)
推荐(0)
摘要:
结果: /** * * @param {*} tel 电话号码 * @returns */ const telFormat = (tel) => { tel = String(tel); return tel.substr(0,3) + "****" + tel.substr(7); }; cons 阅读全文
posted @ 2022-05-26 22:28
前端搬运工bug
阅读(41)
评论(0)
推荐(0)
摘要:
结果: /** * * @param {*} str 字符串 * @returns */ const fistLetterUpper = (str) => { return str.charAt(0).toUpperCase() + str.slice(1); }; console.log(fist 阅读全文
posted @ 2022-05-26 22:26
前端搬运工bug
阅读(24)
评论(0)
推荐(0)