zoukankan      html  css  js  c++  java
  • VS Code快捷创建代码片段

    首先安装插件 vetur

    step1: 
    文件-首选项-用户代码片段,输入vue,点击enter后进入vue.json文件,将下方代码完全覆盖掉以前内容,保存

    step2:测试 
    新进test.vue文件,在vue文件中输入vue,点击table就能自动生成模板了,如果想调整模板内容,在vue.json中修改

    {
      // Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and 
      // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
      // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
      // same ids are connected.
      // Example:
      "Print to console": {
        "prefix": "vue",
        "body": [
          "<!-- $1 -->",
          "<template>",
          "  <div></div>",
          "</template>",
          "",
          "<script>",
          "export default {",
          "  name: '$2',",
          "  data () {",
          "    return {",
          "      $0",
          "    }",
          "  },",
          "",
          "  components: {},",
          "",
          "  computed: {},",
          "",
          "  mounted: {},",
          "",
          "  methods: {}",
          "}",
          "</script>",
          "<style lang="less" scoped>",
          "",
          "</style>",
          "",
        ],
        "description": "Log output to console"
      }
    }
  • 相关阅读:
    Sql的基础知识(一)
    Django--分页功能
    django--基础操作
    CSRF攻击与防御(转载)
    谈谈CSRF
    浅谈Dom遍历
    node50行代码实现壁纸爬取
    node解决request中文乱码问题
    数组去重方法(转载)
    淘宝dns解析错误导致首页打不开
  • 原文地址:https://www.cnblogs.com/chase-star/p/11890906.html
Copyright © 2011-2022 走看看