css - Vuetify - 在 v-card 内水平居中 v-progress-线性

标签 css vuejs2 progress-bar vuetify.js

我有一个自定义组件,它是 Vuetify v-dialog:

<template>
  <v-dialog v-model="input" persistent max-width="400">
    <v-card>
      <v-card-title class="headline">{{ title }}</v-card-title>
      <v-card-text>{{ text }}</v-card-text>
      <BaseButton
         text="Select File"
         @clicked="selectFile"
         color="accent"
         icon="cloud_upload"
      />
      <input
        type="file"
        @change="onFilePicked"
        ref="fileInput"
        class="hideme"
        multiple
      >
      {{uploadedFileNames}}
      <v-flex xs10 class="text-xs-center">
      <v-progress-linear
        height="10"
        color="accent"
        :value="uploadProgress"
      ></v-progress-linear>
      </v-flex>
      <v-card-actions>
        <v-spacer></v-spacer>
        <v-btn color="accent" flat v-if="declineText"
          @click="clicked(false)">{{ declineText }}</v-btn>
        <v-btn color="accent" flat @click="clicked(true)">{{ confirmText }}</v-btn>
      </v-card-actions>
    </v-card>
  </v-dialog>
</template>

使用上面的代码,我得到以下显示:

enter image description here

我需要做的是将进度条在卡片内水平居中。我已经在不同的元素上尝试过各种居中类,但我还没有能够让酒吧移动。如何让进度条水平居中?

最佳答案

为什么不瞄准该栏并将其居中?

 .v-progress-linear {
    display: block;
    width: 100px;
    margin: 0 auto;
}

或者看起来你有一门课可以做到这一点? class="text-xs-center"

如果是 flex 容器:

main {
  display: flex;
  align-items: flex-start;
  background-color: gray;
  padding: 10px;
  width: 300px;
  height: 300px;
}

.v-progress-linear {
  display: block;
  margin: 0 auto;
  width: 100px;
  background-color: teal;
}
<main>
  <div class="v-progress-linear">
  hi
  </div>
</main>

关于css - Vuetify - 在 v-card 内水平居中 v-progress-线性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57730405/

相关文章:

Android - ProgressBar 的次要进度是什么?

javascript - 如何通过点击事件删除Vue Js中的父元素?

ios - spinnerView 无法在 appdelegate 中工作

html - 卷轴底部的大空间

html - 如何在图像中放置图形之间的空间?

unit-testing - 未找到转换选项中的模块 <rootDir>/node_modules/vue-jest

javascript - 在 .vue 组件内嵌套内联模板

javascript - 如何创建类似于 Grooveshark 的进度 "bar"?

javascript - HTML CSS Javascript 汉堡包菜单问题

html - 不同大小的不同屏幕上的页面外观问题