WebStorm创建文件模板---vue模板(tab补全)

一、操作图示

二、vue模板代码

以下是我的vue模板(后续可能会补充注释)

<template>
  <div>
    <div>{{ sum }}</div>
  </div>
</template>

<script>

export default {
  components: {},  //主要作用为动态渲染组件
  props: [], //用于接收来自父组件的数据
  data() { //返回组件实例的data对象的函数
    return {
      example: '',
      sum: '0',
    };
  },
  computed: {
  }, // 用来监控自己定义的变量,该变量不在data里面声明,直接在computed里面定义,进行处理后返回一个结果值
  watch: {
    example(newVal, oldVal){
      this.example = newVal
      this.example = oldVal
    }
  }, //一个对象,键是需要观察的表达式,值是对应回调函数,值也可以是方法名,或者包含选项的对象。
  methods: {},
  beforeCreate() {
    console.log('beforeCreate',1)
  },

  created() {
    this.sum = this.$route.query.sum
    console.log('create',2)
  },

  beforeMount() {
    console.log('beforeMount',3)
  },

  mounted() {
    console.log('mounted',4)
  },

  beforeUpdate() {
    console.log('beforeUpdate',5)
  },

  updated() {
    console.log('updated',6)
  },

  beforeDestroy() {
    console.log('beforeDestroy',7)
  },

  destroyed() {
    console.log('destroyed',8)
  },

}


</script>

<style scoped>

</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值