Skip to content
On this page

代码片段

目录

vscode 中按 ctrl+p 输入 vue.json 即可打开 vue 模板

Step. 1: massCode 代码片段管理

就现在 windows 上使用,也就这个好用了

设置快捷键

vscode 可以将搜索这个命令设置快捷键,我设置 ctrl+shift+i 后,只要输入快捷键就能搜索了

Step. 2: Vue2 init

Vue2 的初始化代码

json
// C:\Users\Reciter\AppData\Roaming\Code\User\snippets\vue.json
{
  "vue2初始化模板": {
    "prefix": "vue2init",
    "body": [
      "<template>",
      "  <div>",
      "    ${0}",
      "  </div>",
      "</template>",
      "",
      "<script>",
      "export default {",
      "  name: '$TM_FILENAME_BASE',",
      "  props: {},",
      "  components: {},",
      "  data () {",
      "    return {",
      "    }",
      "  },",
      "  watch: {},",
      "  computed: {},",
      "  methods: {},",
      "  created () { },",
      "  activated () { },",
      "  mounted () { },",
      "  beforeDestroy () { }",
      "}",
      "</script>",
      "",
      "<style>",
      "</style>"
    ],
    "description": "vue2初始化模板-描述"
  }
}

Released under the MIT License.