vue 动态获取浏览器内容高度并赋值给元素

用到的是vue  style绑定    其中   v-bind=:

以下是代码

<template>

<div class="hello">

  <div  :style="height"></div>

</div>

</template>

<script>

export default {
name: 'hello',
data () {
  return {
    height:{

      '200px',
      height:'',

      backguound:#ccc,

    }
  }
},
components:{
},
created(){
  this.hh()
},
methods:{
  hh(){


    this.height.height=window.innerHeight-153+'px';


  }
}
}

</script>

原文地址:https://www.cnblogs.com/lccluyan/p/8351787.html