Vue的动态设置style 加过渡动画,不用V-show


 

用:style来设置   contentStyleObj

data () {
  return {
    titleName: '项目区域',
    titleUrl: '',
    contentStyleObj: {
      height: ''
    },
    center: { lng: 0, lat: 0 }, //经纬度
    zoom: 3 //地图展示级别
  }
},

然后进入页面的时候

mounted () {
  this.contentStyleObj.height = window.innerHeight - 44 + 'px'
}

由此可以在写动画的时候,在当前的style属性里面加tran...过渡动画

你可能感兴趣的:(vue)