![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前端
StoneVivi
这个作者很懒,什么都没留下…
展开
-
[警告][vue-router] Duplicate named routers definition: {name: “index“, path: “/index“}
[警告][vue-router] Duplicate named routers definition: {name: “index”, path: “/index”}说明路由命名的name属性重复。举例:{name: “index”, path: “/index”, redirect: “/xxx/xxx”}改正:{name: “index”, path: “/indexPage”, redirect: “/xxx/xxx”}若是动态路由,name没有重复也会报类似警告。...原创 2021-03-15 22:03:44 · 875 阅读 · 2 评论 -
写一个eventEmitter类,包括on()、off()、once()、emit()方法
写一个eventEmitter类,包括on()、off()、once()、emit()方法1.on(event, fn) 监听event 事件,事件触发时调用fn函数;2.once(event, fn) 为指定事件注册一个单次监听器,单次监听器最多只触发一次,触发后立即解除监听器;3.emit(event, arg1, arg2, arg3, …): 触发event事件,并把参数arg1, arg2, arg3… 传给事件处理函数;4.off (event, fn) 停止监听某个事件class E转载 2020-11-25 22:15:31 · 1022 阅读 · 1 评论 -
执行npm install时报错: MaxListenersExceededWarning:Possible EventEmitter memory leak detected
执行npm install时报错: MaxListenersExceededWarning:Possible EventEmitter memory leak detected最近几天在用公司的星盘配置我们的运营内管时,发现在执行npm install 时,报了一个MaxListenersExceededWarning:Possible EventEmitter memory leak detected在网上搜了一圈,大都给了个类似的解答;在vue.config.js 文件中添加require('e原创 2020-11-25 21:43:36 · 8239 阅读 · 8 评论 -
移动端的“吸顶”效果
“吸顶”效果“吸顶”效果是比较常见的一种样式效果。.fixed { position: fixed; top: 0; left: 0; bottom: 0;}$(window).scroll(function () { var documentH = $(document).height() var clientW = $(window).width() var clientH = $(window).height() var titleTop = clientW / 750 * 5原创 2020-11-13 00:39:47 · 560 阅读 · 0 评论 -
字符串的转换
字符串的转换数字 布尔值等其他数据类型都可以转换成字符串;一般来说,脚本引擎将根据上下文自动完成这样的转换。例如,当把数字或布尔形变量传给希望接收的字符串变量的函数时,就会先隐式将该数值转换成字符串,再进行处理;var num = 35.00alert(num)如果在赋值语句中要对两个变量执行加法操作,其中一个事字符串变量,而另一个是数字变量,那么数字会自动转换成字符串,再进行连接;var str1 = '4' + 3 + 2 //结果是432var str2 = 4 + 3 + '2' //原创 2020-11-12 21:42:39 · 169 阅读 · 0 评论 -
如何区分平台 -- web浏览器 or 手机端
如何区分平台 – web浏览器 or 手机端作为前端,不得不说说终端的一些事。有些时候,产品要求在web端和手机端展示的样式不一样。那么,我们该怎么去区分不同的终端呢?原创 2020-11-12 21:19:46 · 573 阅读 · 0 评论