vue element 表格高度自适应

 思路:1、先给 table 的高度绑定一个 值(height)

2、data中定义数据

3、获取高度(计算自己需要的值),并赋值

4、钩子函数调用

    
              
              
              
              
              
              
            
          
    new Vue({
        el:"#app",
        data:{
          height:""
        },
        methods:{
            getHeight() {
                this.height = window.innerHeight - 145 + "px";
            }
        },
        created(){
            this.getHeight()
        },
        mounted(){
        },
    })

 

你可能感兴趣的:(JavaScript)