vue3中element-ui loading加载文字颜色改变
时间: 2023-07-13 21:30:23 浏览: 270
在Vue3中使用Element-UI的Loading组件,可以通过以下方式修改加载文字的颜色:
1. 在全局CSS中修改:
```css
.el-loading-text {
color: red;
}
```
2. 在组件中通过scoped CSS修改:
```vue
<template>
<div>
<el-button @click="showLoading">显示Loading</el-button>
<el-loading :text="loadingText" :visible="loadingVisible" :background="loadingBgColor" class="loading-wrapper">
</el-loading>
</div>
</template>
<script>
export default {
data() {
return {
loadingText: '加载中...',
loadingVisible: false,
loadingBgColor: '#fff'
}
},
methods: {
showLoading() {
this.loadingVisible = true;
}
}
}
</script>
<style scoped>
.loading-wrapper .el-loading-text {
color: red;
}
</style>
```
在上面的代码中,我们通过在`.loading-wrapper`下面添加`.el-loading-text`的方式,修改了加载文字的颜色为红色。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)