采用vue-cli 3.0自动生成vue项目,选了ESlint+Prettier,在写request.js的时候,顺手用vscode右击格式化文件(Alt+Shift+F),一下子报了8个问题,如图所示
总结一下,一共两种错误。第一,eslint规定换行后2个空格缩进,vscode格式化后默认是4个空格缩进;第二,匿名函数关键字function 与 小括号 之间不能有空格。
解决之道
1、文件->首选项->设置->... →打开settings.json->用户设置
1 2 "editor.tabSize": 2, "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false editor.tabSize 用来设置 2个空格缩进,javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions 负责定义匿名函数的函数关键字后面的空格处理
2、看图,选择使用空格缩进,继续选择2 即使将sync_binlog设为1,还是会有一种情况导致问题的发生。当使用InnoDB存储引擎时,在一个事务发出COMMIT动作之前,由于sync_binlog为1,因此会将二进制日志立即写入磁盘。如果这时已经写入了二进制日志,但是提交还没有发生,并且此时发生了宕机,那么在MySQL数据库下次启动时,由于COMMIT操作并没有发生,这个事务会被回滚掉。但是二进制日志已经记录了该事务信息,不能被回滚。这个问题可以通过将参数innodb_support_xa设为1来解决,虽然innodb_support_xa与XA事务有关,但它同时也确保了二进制日志和InnoDB存储引擎数据文件的同步。
max_binlog_size 指定了单个二进制日志文件的最大值,如果超过该值,则产生新的二进制日志文件,后缀名+1,并记录到.index文件。从MySQL 5.0开始的默认值为1073 741824,代表1 G(在之前版本中max_binlog_size默认大小为1.1G)
binlog_cache_size 当使用事务的表存储引擎(如InnoDB存储引擎)时,所有未提交(uncommitted)的二进制日志会被记录到一个缓存中去,等该事务提交(committed)时直接将缓冲中的二进制日志写入二进制日志文件,而该缓冲的大小由binlog_cache_size决定,默认大小为32K.如果如果超过此大小,会被定入临时文件。 可以通过show variables like 'binlog_cache_use'查看缓冲使用次数,通过show global status like 'binlog_cache_disk_use'\G 查看使用临时文件次数.
binlog-do-db与binlog-ignore-db 参数binlog-do-db和binlog-ignore-db表示需要写入或忽略写入哪些库的日志。默认为空,表示需要同步所有库的日志到二进制日志。
https://www.58pic.com/c/20036779/
https://www.58pic.com/c/20036759/
https://www.58pic.com/c/20036754/
https://www.58pic.com/c/20036751/
https://www.58pic.com/c/20036748/
https://www.58pic.com/c/20036747/
https://www.58pic.com/c/20036746/
https://www.58pic.com/c/20036740/
https://www.58pic.com/c/20036736/
https://www.58pic.com/c/20036734/
https://www.58pic.com/c/20036731/
https://www.58pic.com/c/20036730/
https://www.58pic.com/c/20036728/
https://www.58pic.com/c/20036725/
https://www.58pic.com/c/20036720/
https://www.58pic.com/c/20036717/
https://www.58pic.com/c/20036713/
https://www.58pic.com/c/20036709/
https://www.58pic.com/c/20036702/
https://www.58pic.com/c/20036694/
https://www.58pic.com/c/20036692/
https://www.58pic.com/c/20036691/
https://www.58pic.com/c/20036687/
https://www.58pic.com/c/20036679/
https://www.58pic.com/c/20036676/
https://www.58pic.com/c/20036674/
https://www.58pic.com/c/20036670/
https://www.58pic.com/c/20036669/
https://www.58pic.com/c/20036667/
https://www.58pic.com/c/20031548/
https://www.58pic.com/c/20031546/
https://www.58pic.com/c/20031543/
https://www.58pic.com/c/20031542/
https://www.58pic.com/c/20031537/
https://www.58pic.com/c/20031535/
https://www.58pic.com/c/20031534/
https://www.58pic.com/c/20031530/
https://www.58pic.com/c/20031529/
https://www.58pic.com/c/20031526/
https://www.58pic.com/c/20031524/
https://www.58pic.com/c/20031516/
https://www.58pic.com/c/20031510/
https://www.58pic.com/c/20031508/
https://www.58pic.com/c/20031506/
https://www.58pic.com/c/20031503/
https://www.58pic.com/c/20031502/
https://www.58pic.com/c/20031501/
https://www.58pic.com/c/20031498/
https://www.58pic.com/c/20031494/
https://www.58pic.com/c/20031491/
https://www.58pic.com/c/20031489/
https://www.58pic.com/c/20031486/
https://www.58pic.com/c/20031482/
https://www.58pic.com/c/20031478/
https://www.58pic.com/c/20031476/
https://www.58pic.com/c/20031474/
https://www.58pic.com/c/20031469/
https://www.58pic.com/c/20031468/
https://www.58pic.com/c/20031466/
https://www.58pic.com/c/20031465/
https://www.58pic.com/c/20031460/
https://www.58pic.com/c/20031459/
https://www.58pic.com/c/20031457/
https://www.58pic.com/c/20031454/
https://www.58pic.com/c/20031452/
https://www.58pic.com/c/20031449/
https://www.58pic.com/c/20031445/
https://www.58pic.com/c/20031443/
https://www.58pic.com/c/20031441/
https://www.58pic.com/c/20031438/
https://www.58pic.com/c/20031434/
https://www.58pic.com/c/20031433/
https://www.58pic.com/c/20031426/
https://www.58pic.com/c/20031423/
https://www.58pic.com/c/20031411/
https://www.58pic.com/c/20031409/
https://www.58pic.com/c/20031407/
https://www.58pic.com/c/20031405/
https://www.58pic.com/c/20031402/
https://www.58pic.com/c/20031399/
https://www.58pic.com/c/20031397/
https://www.58pic.com/c/20031394/
https://www.58pic.com/c/20031391/
https://www.58pic.com/c/20031390/
https://www.58pic.com/c/20031389/
https://www.58pic.com/c/20031386/
https://www.58pic.com/c/20031384/
https://www.58pic.com/c/20031383/
https://www.58pic.com/c/20031379/
https://www.58pic.com/c/20031362/
https://www.58pic.com/c/20031360/
https://www.58pic.com/c/20031358/
https://www.58pic.com/c/20031355/
https://www.58pic.com/c/20031354/
https://www.58pic.com/c/20031352/
https://www.58pic.com/c/20031350/
https://www.58pic.com/c/20031345/
https://www.58pic.com/c/20031326/
https://www.58pic.com/c/20031323/
https://www.58pic.com/c/20031321/
https://www.58pic.com/c/20031316/
https://www.58pic.com/c/20031314/
https://www.58pic.com/c/20031312/
https://www.58pic.com/c/20031309/
https://www.58pic.com/c/20031307/
https://www.58pic.com/c/20031305/
https://www.58pic.com/c/20031304/
https://www.58pic.com/c/20031303/
https://www.58pic.com/c/20031302/
https://www.58pic.com/c/20031301/
https://www.58pic.com/c/20031300/
https://www.58pic.com/c/20031297/
https://www.58pic.com/c/20031295/
https://www.58pic.com/c/20031293/
https://www.58pic.com/c/20031292/
https://www.58pic.com/c/20031288/
https://www.58pic.com/c/20031284/
https://www.58pic.com/c/20031283/
https://www.58pic.com/c/20031282/
https://www.58pic.com/c/20031279/
https://www.58pic.com/c/20031277/
https://www.58pic.com/c/20031274/
https://www.58pic.com/c/20031273/
https://www.58pic.com/c/20031266/
https://www.58pic.com/c/20031265/
https://www.58pic.com/c/20031261/
https://www.58pic.com/c/20031259/
https://www.58pic.com/c/20031256/
https://www.58pic.com/c/20031254/
https://www.58pic.com/c/20031252/
https://www.58pic.com/c/20031249/
https://www.58pic.com/c/20031246/
https://www.58pic.com/c/20031245/
https://www.58pic.com/c/20031243/
https://www.58pic.com/c/20031241/
https://www.58pic.com/c/20031240/
https://www.58pic.com/c/20031239/
https://www.58pic.com/c/20031238/
https://www.58pic.com/c/20031237/
https://www.58pic.com/c/20031168/
https://www.58pic.com/c/20031146/
https://www.58pic.com/c/20031092/
https://www.58pic.com/c/20031034/
https://www.58pic.com/c/20030968/
https://www.58pic.com/c/20030965/
https://www.58pic.com/c/20030962/
https://www.58pic.com/c/20030960/
https://www.58pic.com/c/20030957/
https://www.58pic.com/c/20030953/
https://www.58pic.com/c/20030947/
https://www.58pic.com/c/20030945/
https://www.58pic.com/c/20030942/
https://www.58pic.com/c/20030935/
https://www.58pic.com/c/20030932/
https://www.58pic.com/c/20030931/
https://www.58pic.com/c/20030929/
https://www.58pic.com/c/20030927/
https://www.58pic.com/c/20030921/
https://www.58pic.com/c/20030920/
https://www.58pic.com/c/20030918/
https://www.58pic.com/c/20030912/
https://www.58pic.com/c/20030911/
https://www.58pic.com/c/20030906/
https://www.58pic.com/c/20030904/
https://www.58pic.com/c/20030902/
https://www.58pic.com/c/20030900/
https://www.58pic.com/c/20030897/
https://www.58pic.com/c/20030895/
https://www.58pic.com/c/20030894/
https://www.58pic.com/c/20030893/
https://www.58pic.com/c/20030892/
https://www.58pic.com/c/20030890/
https://www.58pic.com/c/20030888/
https://www.58pic.com/c/20030887/
https://www.58pic.com/c/20030882/
https://www.58pic.com/c/20030881/
https://www.58pic.com/c/20030880/
https://www.58pic.com/c/20030877/
https://www.58pic.com/c/20030874/
https://www.58pic.com/c/20030871/
https://www.58pic.com/c/20030869/
https://www.58pic.com/c/20030865/
https://www.58pic.com/c/20030864/
https://www.58pic.com/c/20030862/
https://www.58pic.com/c/20030861/
https://www.58pic.com/c/20030859/
https://www.58pic.com/c/20030857/
https://www.58pic.com/c/20030853/
https://www.58pic.com/c/20030851/
https://www.58pic.com/c/20030847/
https://www.58pic.com/c/20030845/
https://www.58pic.com/c/20030843/
https://www.58pic.com/c/20030841/
https://www.58pic.com/c/20030837/
https://www.58pic.com/c/20030835/
https://www.58pic.com/c/20030833/
https://www.58pic.com/c/20030832/
https://www.58pic.com/c/20030829/
https://www.58pic.com/c/20030828/
https://www.58pic.com/c/20030827/
https://www.58pic.com/c/20030826/
https://www.58pic.com/c/20030821/
https://www.58pic.com/c/20030819/
https://www.58pic.com/c/20030817/
https://www.58pic.com/c/20030816/
https://www.58pic.com/c/20030815/
https://www.58pic.com/c/20030814/
https://www.58pic.com/c/20030811/
https://www.58pic.com/c/20030809/
https://www.58pic.com/c/20030808/
https://www.58pic.com/c/20030806/
https://www.58pic.com/c/20030805/
https://www.58pic.com/c/20030804/
https://www.58pic.com/c/20030803/
https://www.58pic.com/c/20030802/
https://www.58pic.com/c/20030801/
https://www.58pic.com/c/20030800/
https://www.58pic.com/c/20030798/