Vuetify列表项目未正确显示

时间:2018-05-26 10:40:05

标签: javascript css vue.js vuejs2 vuetify.js

我正在使用vuetify来正确显示列表项,如下面的结构

Interests

btn1 btn2
btn3 btn4

Not Interests

btn1 btn2
btn3 btn4

但标题"兴趣","不是兴趣"未能正确显示。

 <v-layout row wrap>
        <v-flex xs12 v-for="kid in kids">
          <v-card color="blue-grey darken-2" class="white--text">
            <v-card-title primary-title>
            <div>
              <div class="headline">{{kid.name}}</div>
              <span class="grey--text">{{kid.school.name}}</span>
            </div>
              <!--<div>Listen to your favorite artists and albums whenever and wherever, online and offline.</div>-->
            </v-card-title>
            <v-card-actions>
              <v-list>
                <v-list-tile @click="">
                  <v-list-tile-content>
                    <v-list-tile-title>Interests</v-list-tile-title>
                    <div>
                    <v-btn flat dark v-for="(interest, idx) in kid.interests" :key="idx">{{interest}}</v-btn>
                    </div>
                  </v-list-tile-content>
                </v-list-tile>

                <v-divider></v-divider>

                <v-list-tile @click="">
                  <v-list-tile-content>
                    <v-list-tile-title>Not Interests</v-list-tile-title>
                    <div>
                    <v-btn flat dark v-for="(nointerest,idx) in kid.notinterests" :key="idx">{{nointerest}}</v-btn>
                    </div>
                  </v-list-tile-content>
                </v-list-tile>
              </v-list>
            </v-card-actions>

          </v-card>
        </v-flex>
      </v-layout>

我尝试为列表项设置固定高度,但仍然得到错误的对齐。

Codepen

1 个答案:

答案 0 :(得分:1)

正确使用two-line选项

 <v-list two-line>
  ...
 </v-list>

演示https://codepen.io/ittus/pen/aGeJPe

如果需要,您可以设置列表图块的高度

.list__tile {
  height: 5rem !important;
}