【问题标题】:Vuetify 1.5 to 2.0 Column Wrap on BreakpointVuetify 1.5 到 2.0 在断点处换行
【发布时间】:2019-12-22 10:10:36
【问题描述】:

我在使用 Vuetify 2.0 时失去了理智,我需要将旧的 layout/flex 转换为新的 row/col 语法,但我似乎做不到。

我需要将以下内容转换为新的 2.0 语法:

<v-layout row wrap>
  <v-flex xs12 sm4> 1 </v-flex>
  <v-flex xs12 sm4> 2 </v-flex>
  <v-flex xs12 sm4> 3 </v-flex>
</v-layout>

这将使列在 XS 设备上包装,在 SM 设备上包装成一行。

我有以下内容,但是如何用断点“包装”它们?

<v-row>
  <v-col xs="12" sm="4" >1</v-col>
  <v-col xs="12" sm="4" >2</v-col>
  <v-col xs="12" sm="4" >3</v-col>
</v-row>

在 XS 设备上,它应该是:
1
2
3

相反,我将它们组合在一起:1 2 3

这让我非常恼火:(

【问题讨论】:

    标签: vuetify.js


    【解决方案1】:

    要使其工作,您必须将 cols 设置为 auto 或在 1-12 之间,然后调整您的 col 大小视口。

    <v-row>
      <v-col cols="auto" md="4" sm="12" >1</v-col>
      <v-col cols="auto" md="4" sm="12" >2</v-col>
      <v-col cols="auto" md="4" sm="12" >3</v-col>
    </v-row>
    

    或

    <v-row>
      <v-col cols="12" md="4" sm="12" >1</v-col>
      <v-col cols="12" md="4" sm="12" >2</v-col>
      <v-col cols="12" md="4" sm="12" >3</v-col>
    </v-row>
    

    我更喜欢后者。

    【讨论】:

    • 谢谢 :) 这花了我比应该更长的时间
    猜你喜欢
    • 2019-09-16
    • 2020-04-03
    • 1970-01-01
    • 1970-01-01
    • 2014-07-16
    • 1970-01-01
    • 2019-06-19
    • 2020-01-17
    • 1970-01-01
    相关资源
    最近更新 更多