您好,欢迎访问一九零五行业门户网

总结在开发中遇到问题

1、bug-in android7 phone can not slide above注:android 7.0以上,iscroll滑动缓慢迟钝问题解决
what browser are you using?
there was a fix to iscroll's handling of passive events in chrome 55, but a new bug appeared in chrome 56 (confirmed in the iscroll demos).
edit: scouring the githubs, rbmeyers (on the github team), has been posting everywhere with a simple css fix:
touch-action: none;
2、react 使用es6+语法时 事件绑定疑惑在props里使用 onclick={ this.handleclick.bind(this) } 或者 onclick={ (e) => this.handleclick(e) } 或者 onclick={ ::this.handleclick } 都会产生性能问题,所以现在eslint在语法检查时就会阻止这几种写法,问题原因是每一次render的时候如果遇到这些写法,都会重新用handleclick函数与this去绑定从而重新创建一个新的函数,影响性能。
如果使用下面的写法则不会每次都创建:
// 1.  constructor() {this.handleclick = this.handleclick.bind(this); } handleclick(e) { /* ... */ }// 2.  handleclick = (e) => { /* ... */ };
3、webpack-dev-server + hostadmin,导致invalid host header访问webpack启动的server,直接使用localhost和127.0.0.1都可以正常访问,但是修改了host,使用hostname访问,就会显示invalid host header。
原来新版的webpack-dev-server修改了一些东西,默认检查hostname。如果hostname不是配置内的,将不可访问。应该是考虑一些安全的因素,才有这种配置。之前删除过一次node_modules,重新安装之后出现了这个问题。
修复方法
disablehostcheck:true
或者
public: 'local.kingsum.biz'
看文档应该是webpack-dev-server: v1.16.4这个版本合并进来的,所以升级到这个版本之后要注意这个问题
4、select2 初始化默认值xxx.val(status).trigger('change')
me.$statusselect.select2({ data:  [{        id : '1',        text : '有效'        },{        id : '0',        text : '无效'        }     ], }).val(status).trigger('change');
5、如何移除 input type=number 时浏览器自带的上下箭头?
input::-webkit-outer-spin-button,input::-webkit-inner-spin-button {   -webkit-appearance: none; } input[type=number]{   -moz-appearance: textfield; }
以上就是总结在开发中遇到问题的详细内容。
其它类似信息

推荐信息