链接:https://www.jianshu.com/p/dee1fc22f6cb

 

//vue组件
<template>
  <div class="detail">
    <scroll class="content">
      aaaa
    </scroll>
  </div>
</template>

<script>import scroll from "components/common/scroll";
export default {
  name: "detail",
  data() {
    return {
    };
  },
  components: {
    scroll
  },
  },
  mounted() {},
  methods: {}
};
</script>
<style lang="less" scoped>
.detail {
  height: 100vh;
}

.content {
  height: calc(100% - 44px);//100%是相对于父元素detail的,记得符号左右两边有空格
}
</style>
 

  

相关文章:

  • 2022-12-23
  • 2021-06-23
  • 2021-10-07
  • 2022-12-23
  • 2021-11-13
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案