<p>Copyright © 2019<span v-if="getda"> - {{year}}</span> 腾讯科技</p>
return {
              // 当前年
              year:'',
              // 默认隐藏
              getda:false
            }
mounted() {
          // 调用获取年
          this.getCurrentYear()
          }
 methods: {
 // 版权 获取当前年
          getCurrentYear() {
            let date = new Date();
            let y = date.getFullYear();
            this.time = y;
            if (y > 2020 ) {
              this.getda = true
            } else {
              this.getda = false
            }
          },
 }
 
Logo

前往低代码交流专区

更多推荐