右对齐v-list-item-content

时间:2019-10-04 04:48:18

标签: vue.js vue-component vuetify.js

我的脚本是这样的:

=================== ----- ====================- --- ===================

<template>
  <v-card
    max-width="1200"
    class="mx-auto"
  >
    <v-container
      class="pa-2"
      fluid
    >
      <v-row>
        <v-col
          v-for="(item, i) in items"
          :key="i"
        >
          <v-card
            :color="item.color"
            dark
          >
            <v-list-item three-line>

              <v-list-item-avatar
                size="125"
                tile
              >
                <v-img :src="item.src"></v-img>
              </v-list-item-avatar>

              <v-list-item-content class="align-self-start">
                <v-list-item-title
                  class="headline mb-2"
                  v-text="item.title"
                ></v-list-item-title>

                <v-list-item-subtitle v-text="item.artist"></v-list-item-subtitle>
                <v-list-item-subtitle v-text="item.artist"></v-list-item-subtitle>
              </v-list-item-content>

              <v-list-item-content class="align-self-start">
                <v-list-item-title
                  class="headline mb-2"
                  v-text="'right align'"
                ></v-list-item-title>
              </v-list-item-content>

            </v-list-item>
          </v-card>
        </v-col>
      </v-row>
    </v-container>
  </v-card>
</template>

<script>
  export default {
    data: () => ({
      items: [
        {
          color: '#1F7087',
          src: 'https://cdn.vuetifyjs.com/images/cards/foster.jpg',
          title: 'Supermodel',
          artist: 'Foster the People',
        }
      ],
    }),
  }
</script>

=================== ----- ====================- --- ==================

结果是这样的:

Result image

我要“右对齐” 在正确的位置

我该怎么办?

请帮助我,伙计们。非常感谢

2 个答案:

答案 0 :(得分:0)

在两个<v-spacer></v-spacer>之间使用<v-list-item-content>

 <v-list-item-content class="align-self-start">
                <v-list-item-title
                  class="headline mb-2"
                  v-text="item.title"
                ></v-list-item-title>

                <v-list-item-subtitle v-text="item.artist"></v-list-item-subtitle>
                <v-list-item-subtitle v-text="item.artist"></v-list-item-subtitle>
              </v-list-item-content>
<!-- This one -->  <v-spacer></v-spacer> <!-- This one -->
              <v-list-item-content class="align-self-start">
                <v-list-item-title
                  class="headline mb-2"
                  v-text="'right align'"
                ></v-list-item-title>
              </v-list-item-content>

答案 1 :(得分:0)

您可以使用helper class来对齐文本。

<v-list-item-content class="text-right align-self-start">
    <v-list-item-title
        class="headline mb-2"
        v-text="'right align'"
        >
    </v-list-item-title>
</v-list-item-content>