vscode中vue单文件组件快捷初始化模板:vue+tab

{
    "Print to console": {
        "prefix": "vue",
        "body": [
            "<template>",
            "<div>\n",
            "</div>",
            "</template>\n",
            "<script>",
            "export default {",
            "  name: '',",
            "  props: [],",
            "  components: {},",
            "  data () {",
            "    return {}",
            "  },",
            "  computed: {},",
            "  methods: {},",
            "  watch: {},",
            "  beforeCreate () {},",
            "  created () {},",
            "  beforeMount () {},",
            "  // mounted () {},",
            "  beforeUpdate () {},",
            "  updated () {},",
            "  activated () {},",
            "  deactivated () {},",
            "  beforeDestroy () {},",
            "  destroyed () {},",
            "  errorCaptured () {},",
            "}",
            "</script>\n",
            "<style scoped lang=\"${1:less}\">\n",
            "</style>\n",
        ],
        "description": "Create vue template"
    }
}

  

上一篇:笔记:Vue组件的生命周期(钩子函数)


下一篇:vue keep-alive以及activated,deactivated生命周期的用法