我喜欢这个选项。
<v-card :loading="loading">...
但我希望将样式从线性进度条更改为(例如)覆盖层。我知道可以通过绑定颜色而不是布尔值(true)来更改颜色。
<v-card :loading="'red'">...
但我能以这样的方式改变行为吗?可以将进度条加粗或者更好的方式是,在loading=true
时显示叠加层吗?
我喜欢这个选项。
<v-card :loading="loading">...
但我希望将样式从线性进度条更改为(例如)覆盖层。我知道可以通过绑定颜色而不是布尔值(true)来更改颜色。
<v-card :loading="'red'">...
但我能以这样的方式改变行为吗?可以将进度条加粗或者更好的方式是,在loading=true
时显示叠加层吗?
v-progress-linear
更改为 v-progress-overlay
,并希望一切按预期工作之外,你几乎没有更多选择。v-card
插槽,有以下内容:template
,但只能限制于 "progress linear"。<v-card :loading="loading">
<template slot="progress">
<v-progress-linear color="red" indeterminate></v-progress-linear>
</template>
...
</v-card>
就像 CodePen 的示例 一样。
根据vuetify文档,loading属性可以是指定颜色的字符串或布尔值。
因此,您可以通过以下方式轻松设置加载动画的颜色:
<v-card :loading="loading ? 'red': null">
...
</v-card>
<v-card class="ma-auto" width="300" height="300" :loading="loading">
<template slot="progress">
<v-overlay absolute class="d-flex flex-column text-center">
<div>
<v-progress-circular size="75" color="accent " :value="loadingProgress" indeterminate>
<span>Loading</span>
</v-progress-circular>
</div>
<div>
<v-btn text dark @click="loading = false" class="mt-3">Deactivate loading</v-btn>
</div>
</v-overlay>
</template>
<v-card-title></v-card-title>
<v-card-text></v-card-text>
<v-card-actions class="justify-center">
<v-btn @click="loading = true">Activate loading</v-btn>
</v-card-actions>
</v-card>
main.css
中设置,以便该效果适用于我项目中的所有页面? - alhelal.v-progress-linear{color: red}
- alhelal<v-progress-linear color="#bada55"...
- balexandre