码迷,mamicode.com
首页 > Web开发 > 详细

Vue.js 内联样式绑定style

时间:2018-11-19 11:13:22      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:var   ret   htm   div   pre   style   The   span   ted   

html

<div class="Menu" v-bind:style="{height:clientHeight}">
 </div>

js

    data(){
        return{
            clientHeight:‘‘, 
        }
    },
    mounted(){
        var h= document.documentElement.clientHeight+px
        this.clientHeight=h
    },
动态改变元素高度

 

Vue.js 内联样式绑定style

标签:var   ret   htm   div   pre   style   The   span   ted   

原文地址:https://www.cnblogs.com/xxflz/p/9981356.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!