zoukankan      html  css  js  c++  java
  • vue笔记

    //vue防止冒泡
    event.stopPropagation();

    //vue 的 :class
    http://www.cnblogs.com/cina33blogs/p/6738038.html


    //vue的unwatch DEMO 滚动刷新数据 items为请求后台的数据,页面做的轮询
    self.unwatch = self.$watch('items', function (newValue, oldValue) {
    var count = 0;
    if(newValue.length!=oldValue.length){
    count++;
    }
    if(count!=0&&document.getElementById('myData')){
    this.$nextTick(() => {
    var container = this.$el.querySelector("#myData");
    container.scrollTop = container.scrollHeight;
    });
    // document.getElementById('myData').scrollTop = 0;//前面数据刷新
    }
    });

    //vue的interval

    this.handle = setInterval(() => {
    },8000);
    ,beforeDestroy(){
    clearInterval(this.handle);
    }


     
  • 相关阅读:
    基本样式
    表单基础知识
    边框内圆角
    灵活的背景定位
    多重边框
    半透明边框
    变量关系
    闭包2——闭包与变量
    闭包
    基本包装类型
  • 原文地址:https://www.cnblogs.com/susuhyc/p/6958566.html
Copyright © 2011-2022 走看看