【问题标题】:Computed Bootstrap Breakpoints in Nuxt jsNuxt js 中的计算引导断点
【发布时间】:2021-03-03 08:23:30
【问题描述】:

对于仅在 NuxtJs 应用程序中的客户端中具有实时活动的 Bootstrap 断点(如计算数据)的最佳解决方案是什么?

在 Bootstrap 中,我们有像 d-lg-block 这样的类。 我想在 VueJs 中使用 v-if 来做到这一点。 像: <div v-if="lgAndUpper"></div>

【问题讨论】:

    标签: twitter-bootstrap vue.js bootstrap-4 vuejs2 nuxt.js


    【解决方案1】:

    你可能需要这个。调整浏览器大小后,将触发此事件。你可以把它放在mounted() 让它工作。

    window.addEventListener("resize", function(event) {
        console.log(document.body.clientWidth + ' wide by ' + document.body.clientHeight+' high');
    })
    

    【讨论】:

      猜你喜欢
      • 2023-03-08
      • 2018-07-15
      • 1970-01-01
      • 1970-01-01
      • 2018-05-12
      • 1970-01-01
      • 2016-01-28
      • 2017-10-07
      • 2020-09-26
      相关资源
      最近更新 更多