美文网首页
vscode新建vue代码块,class默认为文件名

vscode新建vue代码块,class默认为文件名

作者: FRESHOME | 来源:发表于2020-06-01 16:09 被阅读0次
    {
        "Print to console": {
            "prefix": "vue",
            "body": [
                "<template>",
                "<div class='$TM_FILENAME_BASE'>$1</div>",
                "</template>",
                "",
                "<script>",
                "export default {",
                "components: {},",
                "data() {",
                "return {}",
                "},",
                "methods: {},",
                "mounted() {}",
                "}",
                "</script>",
                "<style lang='scss' scoped>",
                "</style>"
            ],
            "description": "Log output to console"
        }
    }
    
    1. prefix:定义一个或多个触发词,以在IntelliSense中显示代码片段。子字符串匹配在前缀上执行,因此在这种情况下,“ fc”可以匹配“ for-const”。
    2. 使用$name${name:default},插入变量的值。
    • TM_FILENAME_BASE 当前文档的文件名,不带扩展名

    https://code.visualstudio.com/docs/editor/userdefinedsnippets

    相关文章

      网友评论

          本文标题:vscode新建vue代码块,class默认为文件名

          本文链接:https://www.haomeiwen.com/subject/gurszhtx.html