VScode自定义代码片段

打开VScode

    

  • 进入 snippet 设置文件,这里提供了两种方法: 
    • 摁「Alt」键切换菜单栏,通过文件 > 首选项 > 用户代码片段,选择进入目的语言的代码段设置文件;
    • 通过快捷键「Ctrl + Shift + P」打开命令窗口(all command window),输入「snippet」,通过候选栏中的选项进入目的语言的代码段设置文件。
  • 填写 snippets

vue:

 {

"Print to console": {
"prefix": "vue",
"body": [
"<!-- $0 -->",
"<template>",
" <div></div>",
"</template>",
"",
"<script>",
"export default {",
" data () {",
" return {",
" };",
" },",
"",
" components: {},",
"",
" computed: {},",
"",
" mounted: {},",
"",
" methods: {}",
"}",
"",
"</script>",
"<style scoped>",
"</style>"
],
"description": "Log output to console"
}

}

猜你喜欢

转载自blog.csdn.net/w1019945543/article/details/79446069