
前端
文章平均质量分 50
lemon0__0tree
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
javascript中的严格模式
1.概述除了正常运行模式,ECMAscript 5添加了第二种运行模式:"严格模式"(strict mode)。顾名思义,这种模式使得Javascript在更严格的条件下运行。 2.为什么用严格模式- 消除Javascript语法的一些不合理、不严谨之处,减少一些怪异行为;- 消除代码运行的一些不安全之处,保证代码运行的安全;- 提高编译器效率,增加运行速度;- 为未来新版本的Javascript...原创 2018-04-17 17:06:22 · 137 阅读 · 0 评论 -
css module
常见的样式的添加方式<div className='wrap'> <Slide rotationMap={this.state.rotationMap}/></div>除此之外,还有另外的方法,使用之前要先开启css module,在webpack中添加 modules:true的配置{ test: /\.scss$/, exclude...原创 2018-05-07 19:43:02 · 332 阅读 · 0 评论 -
开启css module导致antd-mobile的样式失效
在react中使用antd-mobile的走马灯,奇怪的是下面的小圆点一直显示不出来,引入antd-mobile都没有错,轮播图的部分样式没有正常显示,于是在网上查找原因。最后发现原来是我开启了css module使antd-mobile的样式失效了。怎么解决这个问题呢?添加 exclude:[/node_modules/] 只对自己的css 开启module{ test: /\.css$...原创 2018-05-07 19:30:58 · 4251 阅读 · 0 评论 -
stage-0
做react的过程中,发现ES6的某些语法不能编译为ES5。经查找原因得知babel编译ES6代码,需要stage-0插件1、npm install -S babel-preset-stage-02、在webpack.config.js的presets中添加stage-0{ test: /\.jsx|.js$/,//以js结尾的文件,使用babel-loader进行解析 loader:...原创 2018-05-07 19:15:21 · 478 阅读 · 0 评论 -
如何区分Babel中的stage-0,stage-1,stage-2以及stage-3(一)
大家知道,将ES6代码编译为ES5时,我们常用到Babel这个编译工具。大家参考一些网上的文章或者官方文档,里面常会建议大家在.babelrc中输入如下代码:{ "presets": [ "es2015", "react", "stage-0" ], "plugins": [] }我们现在来说明下这个配置文件是什么意思。首先,这个配置...转载 2018-05-07 19:07:13 · 453 阅读 · 0 评论 -
webpack中jquery和antd-mobile的配置
1、在react中引入了antd-mobile,报如下的错误You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.详细的可以参考文档:https://ant.design/docs/react在webp...原创 2018-05-06 23:52:57 · 1730 阅读 · 0 评论 -
js中的相对路径和绝对路径
dist 相对路径let a = path.resolve(__dirname,'dist');console.log('a',a);// a E:\graduationproject\myapp\dist/dist 绝对路径let b = path.resolve(__dirname,'/dist');console.log('b',b);// b E:\dist./dist...原创 2018-05-06 17:20:47 · 6349 阅读 · 0 评论 -
path.resolve和path.join
1、path.resolve(ag1,ag2,...)path.resolve返回当前环境所在路径拼接参数字符串所得到的绝对路径,其中参数可以有多个const path = require('path');path.resolve('/foo/bar', './baz')// returns '/foo/bar/baz'path.resolve('/foo/bar', '/tmp/file/...转载 2018-05-06 16:35:50 · 666 阅读 · 0 评论 -
用伪元素画线
<style type="text/css"> .or{ width: 450px; text-align: center; position: relative; } .or:before,.or:after{ content: ''; position: absolute; ...原创 2018-04-28 00:18:33 · 2375 阅读 · 0 评论 -
画一个有边缘色的三角形
<style type="text/css">.chat-msg{ width: 300px; height: 80px; border: 1px solid #ccc; border-radius: 8px; position: relative; filter: drop-shadow(0 0 2px #999); back...原创 2018-04-27 23:59:13 · 191 阅读 · 0 评论 -
用css画一个三角形
<style type="text/css">.triangle{ width: 0; height: 0; border-top: 50px solid #000; border-right: 50px solid #d00; border-bottom: 50px solid #333; border-left: 50px soli...原创 2018-04-27 23:56:06 · 130 阅读 · 0 评论 -
css3伪类
1、focus的时候字体颜色加深<style type="text/css">/*正常状态为浅灰色*/ .icon-search{ color: #ccc; }input[type=search]:focus + .icon-search{ color: #111;}</style><input type="searc...原创 2018-04-27 23:09:09 · 635 阅读 · 0 评论 -
自定义radio/checkbox的样式
借助css3提供的一个伪类 :checked,只要radio/checkbox处于选中状态,这个伪类就会生效,因此可以利用选中和非选中这两种状态,去切换不同的样式。<style type="text/css"> input[type=checkbox]{ display: none; } /*未选中的checkbox的样式*/ .checkbox{ ...原创 2018-04-27 16:04:03 · 211 阅读 · 0 评论 -
js赋值表达式
if(a = 0){ console.log('0');}else{ console.log('ok');}输出结果是ok,整个条件表达式发生了两件事1、运行赋值表达式,整个表达式的值是02、类型转换,将数值0转换为布尔类型(Boolean(0) = false),结果为false...原创 2018-04-25 12:09:16 · 604 阅读 · 0 评论 -
js继承的5种方式
一、构造函数绑定使用call或apply方法,将父对象的构造函数绑定在子对象上。function Animal(){ this.species = "动物";} function Cat(name,color){ Animal.apply(this,arguments); this.name=name; this.color=color;} var ...转载 2018-04-25 09:49:56 · 158 阅读 · 0 评论 -
There are multiple modules with names that only differ in casing
./pages/Reg/index.scss (./node_modules/_css-loader@0.28.11@css-loader??ref--6-1!./node_modules/_sass-loader@7.0.1@sass-loader/lib/loader.js!./pages/Reg/index.scss)There are multiple modules with names...原创 2018-05-09 11:02:03 · 12781 阅读 · 0 评论 -
定位当前地理位置
根据用户的地理位置提供相关地区服务,已经是非常普遍的一项功能,例如本地生活类网站、外卖网站等。HTML5新功能中提供了获取用户位置的能力,使用HTML5 Geolocation API来构建基于地理位置的应用。Geolocation API通过navigator.geolocation全局对象进行访问。初次访问时,浏览器会询问用户是否共享位置,若用户选择允许程序使用Geolocation API权...转载 2018-05-02 10:57:40 · 12238 阅读 · 0 评论 -
ES6 声明变量的六种方法
ES5 只有两种声明变量的方法:var命令和function命令。ES6 除了添加let和const命令,另外两种声明变量的方法:import命令和class命令。所以,ES6 一共有 6 种声明变量的方法。...原创 2018-04-17 17:55:32 · 2104 阅读 · 0 评论 -
分享一个学习react.js的网站
http://huziketang.mangojuice.top/books/react/lesson32 虚拟dom:https://github.com/livoras/blog/issues/13原创 2018-09-11 10:27:25 · 606 阅读 · 0 评论