2022年11月18日

Js保留到小数点后有数位、decimal有效数位

摘要: 链接:https://blog.csdn.net/a772116804/article/details/125916129 假设1w 我们需要除以1亿 10010/100000000 ≈ 0.0001 const decimalFn = (num) => { if (Number.isInteger 阅读全文

posted @ 2022-11-18 11:35 妍若菲 阅读(195) 评论(0) 推荐(0) 编辑

2022年7月29日

vue判断路由变化

摘要: watch: { $route: "routerChange" } methods: { routerChange(to, from) { if (to.name == "trade") { this.showfooter = false; } } }, 阅读全文

posted @ 2022-07-29 12:16 妍若菲 阅读(212) 评论(0) 推荐(0) 编辑

2022年5月6日

Vue—babel.config.js配置文件详解

摘要: 一、概述Babel是一个JS编译器,主要作用是将ECMAScript 2015+ 版本的代码,转换为向后兼容的JS语法,以便能够运行在当前和旧版本的浏览器或其它环境中。 Vue项目中普遍使用ES6语法,若要求兼容低版本浏览器,就需要引入Babel,将ES6转换为ES5。 二、详解Vue3.0项目根目 阅读全文

posted @ 2022-05-06 11:18 妍若菲 阅读(1621) 评论(0) 推荐(0) 编辑

2022年2月26日

js保留两位小数,不四舍五入

摘要: function formatDecimal(num, decimal) { num = num.toString() let index = num.indexOf('.') if (index !== -1) { num = num.substring(0, decimal + index + 阅读全文

posted @ 2022-02-26 09:54 妍若菲 阅读(585) 评论(0) 推荐(0) 编辑

2022年2月25日

小数点后两位正则

摘要: <input type="tel" onkeyup="Num(this) placeholder="保留两位小数"> function Num(obj){ obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输 阅读全文

posted @ 2022-02-25 18:09 妍若菲 阅读(105) 评论(0) 推荐(0) 编辑

2019年8月5日

时间戳转化

摘要: function timestampToTime(timestamp) { var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = date.getFullYear() + '-'; var M = 阅读全文

posted @ 2019-08-05 15:56 妍若菲 阅读(76) 评论(0) 推荐(0) 编辑

2019年3月21日

UI

摘要: 8个高质量免抠素材网站 1.PngImg 网址: http://pngimg.com/ PngImg 网站是一个收录了近5万个免费的网页设计图片素材的站点,拥有详细的分类,如蔬菜、动物、水果、花卉、服装、食品、家具等等,所有的素材资源设计师们都可以无需注册免费下载使用。 PngImg 网站内建搜寻功 阅读全文

posted @ 2019-03-21 09:13 妍若菲 阅读(296) 评论(0) 推荐(0) 编辑

2018年9月6日

点击li任意项下拉隐藏-toggle

摘要: $('.hot_zone_wrap').on('click', '.hot_news_title', function(e){ var index = $(".hot_zone_wrap .hot_news_title").index(e.currentTarget); $($('.hot_news 阅读全文

posted @ 2018-09-06 10:05 妍若菲 阅读(127) 评论(0) 推荐(0) 编辑

导航