关于vue告警:Closing curly brace does not appear on the same line as the subsequent block

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/dreamstone_xiaoqw/article/details/90378794

最近在用vscode写vue,有两个目的,一方面是重构下小编渣站的前端,另一方面也是主要原因:

小编见到新技术就像狼闻到肉,老光棍看到俏姑娘,心里跟猫挠似的,不下手尝尝鲜那真是食不甘味、寝不安席。

So,毛毛躁躁上下其手不亦乐乎~

整理代码时控制台报了一个警告:

✘  http://eslint.org/docs/rules/brace-style  Closing curly brace does not appear on the same line as the subsequent block
  src\components\question.vue:74:7
}

这行警告的关键信息:

Closing curly brace does not appear on the same line as the subsequent block……

百度翻译如下:

右大括号与下一个块不在同一行

也就是说,在当前场景大括号不能单独占一行。(PS:为了节省纸张么?环保从我做起?)

用代码来说明,即:将

if (flag) {
	doSomeThing();
}
else {
	doOtherThing();
}

修改为

if (flag) {
	doSomeThing();
} else {
	doOtherThing();
}

即可。

阿西吧,不得不感叹,vue对编程风格的约束真是严格啊,这样的小事情都要管……

附静态代码检查工具eslint的专业解答:https://eslint.org/docs/1.10.3/rules/brace-style

展开阅读全文

finally block does not complete normally

05-23

所有的finally块均出现:[b]finally block does not complete normally[/b][color=#FF0000][/color]rnrnwhy?期待大虾指教!^_^rnrnrn[code=Java]//本JavaBean包括数据的插入、更新、删除和查询等。rnrnpackage lee.javaBean;rnrnrnrnimport java.sql.*;rnrnpublic class DBUtilrnrn private DBLink dblink=new DBLink();rn private Statement stmt;rn private ResultSet rs; rn rnrn //获取查询的行数:没有结果返回-1,查询异常返回-2;rn rn public int getRowCount(String strSql)rn rn int intCount=0;rn tryrn rn stmt=dblink.getStmtread();rn rs=stmt.executeQuery("SELECT COUNT(*) FROM"+strSql);rn if(rs.next())rn rn intCount=rs.getInt(1);rn rn else intCount=-1; rn rn catch(Exception e)rn rn intCount=-2; rn rn finallyrn rn dblink.close();rn return intCount;rn rn rn rn //执行插入操作 rn public int insert(String strSql)rn rn int count=0;rn stmt=dblink.getStmt();rn tryrn rn count=stmt.executeUpdate(strSql);rn rn rn catch(Exception e)rn rn count=-2;rn System.err.println(e.getMessage());rn e.printStackTrace();rn rn finallyrn rn dblink.close();rn return count;rn rn rn rn rn //更新数据库数据rn public int update(String sql)rn rn int count=0;rn stmt=dblink.getStmt();rn tryrn rn count=stmt.executeUpdate(sql);rn rn catch(Exception e)rn rn count=-2;rn System.err.print(e.getMessage());rn e.printStackTrace();rn rn finallyrn rn dblink.close();rn return count;rn rn rn rn rn rn //删除数据库数据rn rn public int delete(String sql)rn rn int count=0;rn stmt=dblink.getStmt();rn tryrn rn count=stmt.executeUpdate(sql);rn rn rn rn catch(Exception e)rn rn count=-2;rn System.err.println(e.getMessage());rn e.printStackTrace();rn rn rn rn finallyrn rn dblink.close();rn return count;rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code] 论坛

Same or not

07-21

Problem DescriptionnEveryone konws how to traveling a tree using the DFS strategy. But we also know that there are many ways to do so. For example, giving a tree as the following picture, we may get three ways: 010011, 001101, 01010011. 0 stands for the down operation while 1 means the up operation.nNow we make a constraint: if one node has k direct childs, you can visit a node at most 2*k times, if k == 0, you can visit it only once, in the example, the root has two direct child. Like the example, you can only get two ways: 010011, 001101. Because the way 01010011 will visit the node in yellow four times.nHere is the problem: ACboy drawed a tree, but is not very nice, so he won't show you the picture. Instread he will give you two strings indicating that the ways to travel the tree. Of cource, the strings will only contain 0 and 1. And your mission is to tell whether ACboy is telling the truth. For example, he drawed a picture as the following, if he give you 010011 and 001101, then he is telling the truth, but if he give you 010011 and 01010011, you konw that he is telling a lie.nn nnInputnOn the first line of input is a single positive integer n, telling the number of test scenarios to follow.Each test case consists of two lines, each containing a string of the characters '0' and '1' of length at most 3000, both describing a way to travel the tree.n nnOutputnFor each test case output a line containing the word "True" or the word "False", depending on whether ACboy is telling the truth.n nnSample Inputn2n010011n001101n010011n01010011n nnSample OutputnTruenFalsen 问答

没有更多推荐了,返回首页