【问题标题】:How to fill the width of the content in vuetifyvuetify中如何填充内容的宽度
【发布时间】:2018-06-18 06:47:34
【问题描述】:
  1. 我想要的是用 vuetify 填充整个手机屏幕的宽度

使用此代码:

 <v-content>
    <router-view>
      <v-container fluid></v-container>
    </router-view>
  </v-content>

路由器视图左右两边都有边距

  1. 并且底部导航已经安装在屏幕上,我不会拖动屏幕来显示底部导航

【问题讨论】:

  • router-view 不应该在v-container 里面吗?容器 afaik 有填充,所以我想你可以添加 class="px-0" 来实现全宽
  • 我只从文档中复制
  • 至于你的第二个问题,它应该是单独的imo,因为它与原始问题无关(如果我理解正确的话)。
  • 如果删除 fluid 不起作用?
  • @Traxo 是的,你是对的,我只是列举了问题。哈哈

标签: vue.js vuetify.js


【解决方案1】:

我只需要在移动设备上动态删除填充,这对我有用:

<v-container :class="{'px-0': $vuetify.breakpoint.xsOnly }">
   <router-view> </router-view>
</v-container>

目前我找不到太多文档,但查看code 我发现了这些:

// Breakpoint ranges. 
xsOnly,
smOnly, 
smAndDown,
smAndUp,
mdOnly,
mdAndDown,
mdAndUp,
lgOnly,
lgAndDown,
lgAndUp,
xlOnly,

【讨论】:

    【解决方案2】:

    你也可以试试这个,vuetify有helper classes来设置padding和margin

    <v-container fluid  class="pa-0 ma-0">
    </v-container>
    

    【讨论】:

      【解决方案3】:

      v-container 使用类容器创建一个 div。此类为您的 div 提供了四面八方的填充。 (数量取决于viewport breakpoint;xs 为 2px,xl 为 24px)。如果您在 css 中包含以下内容,则您的侧边距应该消失。

      .container {
         padding: 0!important
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-06
        • 1970-01-01
        • 2018-11-25
        • 2020-02-03
        • 1970-01-01
        • 2021-12-27
        相关资源
        最近更新 更多