webstrom添加模板代码

添加模板代码

  • file > setting > Live Templates > 选择文件类型
  • 文件 > 设置 > 编辑器 > 实时模板 (设置的是在文件内用快捷键生成的代码)
  • 文件 > 设置 > 编辑器 > 文件和代码模板 (设置的是默认类型文件的代码)

;


vue2 模板默认配置

<template>
  <section>
  </section>
</template>
<script>
export default {
  name: "",
  data() {
    return {};
  },
  computed: {},
  methods: {},
  props: {},
  // Vue 实例将会在实例化时调用 watch(),遍历 watch 对象的每一个 property。
  watch: {},
  beforeCreate() {},
  created() {},
  beforeMount() {},
  mounted() {},
  // 被 keep-alive 缓存的组件激活时调用。
  activated() {},
  // 被 keep-alive 缓存的组件停用时调用。
  deactivated() {},
  // 实例销毁之前调用。在这一步,实例仍然完全可用。
  beforeDestroy() {},
  destroyed() {},
  components: {},
  filters: {},
  directives: {},
  mixins: [],
  beforeRouteEnter(to, from, next) {
    window.document.body.style.backgroundColor = "";
    // window.document.title="title"
    next();
  },
  beforeRouteLeave(to, from, next) {
    window.document.body.style.backgroundColor = "";
    // window.document.title="title"
    next();
  }
};
</script>
<style lang="css" scoped>
</style>

原文地址:https://www.cnblogs.com/kgwei520blog/p/15665789.html