{
"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"
}
}
- prefix:定义一个或多个触发词,以在IntelliSense中显示代码片段。子字符串匹配在前缀上执行,因此在这种情况下,“ fc”可以匹配“ for-const”。
- 使用$name或${name:default},插入变量的值。
- TM_FILENAME_BASE 当前文档的文件名,不带扩展名
https://code.visualstudio.com/docs/editor/userdefinedsnippets
网友评论