eclipse - 如何在 STS 中以更好的方式格式化 JS 代码
问题描述
手动格式化 JS 代码后如下所示
txnDetailsTable = $('#transactionDetails').dataTable({
bLengthChange : false,
bInfo : false,
bSort : false,
autoWidth : false,
columnDefs : [ {"width" : "15%","targets" : 0},
{"width" : "7%","targets" : 1},
{"width" : "5%","targets" : 2},
{"width" : "33%","targets" : 3},
{"width" : "5%","targets" : 4},
{"width" : "5%","targets" : 5},
{"width" : "12%","targets" : 6},
{"width" : "13%","targets" : 7},
{"width" : "13%","targets" : 8}
],
aoColumns : [ {
"sType" : "date"
}, null, null, null, null, null, null, null, null ]
按下ctrl++shift后F,上面的 JS 代码格式更改如下。
txnDetailsTable = $('#transactionDetails').dataTable({
bLengthChange : false,
bInfo : false,
bSort : false,
autoWidth : false,
columnDefs : [ {
"width" : "15%",
"targets" : 0
}, {
"width" : "7%",
"targets" : 1
}, {
"width" : "5%",
"targets" : 2
}, {
"width" : "33%",
"targets" : 3
}, {
"width" : "5%",
"targets" : 4
}, {
"width" : "5%",
"targets" : 5
}, {
"width" : "12%",
"targets" : 6
}, {
"width" : "13%",
"targets" : 7
}, {
"width" : "13%",
"targets" : 8
} ],
aoColumns : [ {
"sType" : "date"
}, null, null, null, null, null, null, null, null ]
ctrl按下++后如何保持上述shift格式F?
解决方案
推荐阅读
- html - 如何停止悬停时的快速晃动
- .net-core - 基于资源的(命令式)授权不会进入处理程序
- wordpress - 以自定义运输方式获取客户地址
- php - 如何在 Doctrine for MongoDB 中添加条件
- tensorflow - 模块“tensorflow.keras.datasets.mnist”没有属性“x_train”
- javascript - 带有实时数据的 Vue 刷新页面
- scala - 使用另一个 DF 的列过滤 DF(两个 DF 中的列相同)Spark Scala
- powershell - 我无法解决“'System.OutOfMemoryException' 类型的异常”这个错误
- python - 将粗体文本写入文件
- google-cloud-platform - 谷歌云外壳,以便在注销时继续该过程