zoukankan      html  css  js  c++  java
  • vsCode设置代码片段

     输入vue.json

    {
        "Print to console": {
        
            "prefix": "vv",
        
            "body": [
        
            "<template>",
        
            "   <div>$0</div>",
        
            "</template>",
        
            "",
        
            "<script>",
        
            "export default {",
            "",
            "    components: {",
            "",    
            "    },",
            "",    
            "    data() {",
            "        return {",
            "            ",    
            "        }",
            "    },",
            "",
            "    created() {",
            "",
            "    },",
            "",
            "",
            "    mounted() {",
            "        this.onLoad()",
            "    },",
            "",
            "    methods: {",
            "        onLoad() {}",
            "    }",
            "",
            "}",
        
            "",
        
            "</script>",
        
            "<style lang="scss">",
            "",
            "</style>",
        
            "",
        ],
        
        "description": "Log output to console"
        }
    }

    字段注释

    prefix :这个参数是使用代码段的快捷入口,比如这里的log在使用时输入log会有智能感知.
    body :这个是代码段的主体.需要设置的代码放在这里,字符串间换行的话使用 
    换行符隔开.注意如果值里包含特殊字符需要进行转义.
    $1 :这个为光标的所在位置.
    $2 :使用这个参数后会光标的下一位置将会另起一行,按tab键可进行快速切换
    description :代码段描述,在使用智能感知时的描述
  • 相关阅读:
    P5107 能量采集
    P4655 [CEOI2017]Building Bridges
    P1129 [ZJOI2007]矩阵游戏
    P5299 [PKUWC2018]Slay the Spire
    P1625求和 giao精大杂烩
    背包
    根号分治
    CF963B
    国王游戏
    P6006 USACO 3SUM G
  • 原文地址:https://www.cnblogs.com/ll15888/p/12084806.html
Copyright © 2011-2022 走看看