Visual Sudio代码中的Bootstrap 3 Snippets

时间:2018-03-25 13:29:38

标签: javascript twitter-bootstrap visual-studio-code code-snippets

我正在使用visual studio代码,当调用任何bs3 snipper时,它会创建额外的顶部和底部空行。 有人请告诉我如何防止这种情况?

enter image description here

绿线是我想自动删除的 谢谢

1 个答案:

答案 0 :(得分:1)

为此,您需要在以下路径snippets.json下编辑bootstrap-3代码段文件C:\Users\<Username>\.vscode\extensions\wcwhitehead.bootstrap-3-snippets-0.1.0\snippets,并从每个代码段中删除第一个和最后一个\n,如下例所示(restatr VS Code更新后)。
原始片段:

 "bs3-alert:danger": {
        "prefix": "bs3-alert:danger",
        "body": "\n<div class=\"alert alert-danger\">\n\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\n\t<strong>${1:Title!}</strong> ${2:Alert body ...}\n</div>\n",
        "description": "Danger Alert Box",
        "scope": ""
 },

更新了代码段:

"bs3-alert:danger": {
        "prefix": "bs3-alert:danger",
        "body": "<div class=\"alert alert-danger\">\n\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\n\t<strong>${1:Title!}</strong> ${2:Alert body ...}\n</div>",
        "description": "Danger Alert Box",
        "scope": ""
 },