element-ui 中的 loading 加載功能,默認是全屏加載效果,文章來源:http://www.zghlxwxcb.cn/news/detail-678628.html
設置局部,需要自定義樣式,自定義的方法如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-678628.html
import { Loading } from 'element-ui'
Vue.prototype.$baseLoading = (text) => {
let loading
loading = Loading.service({
lock: true,
customClass: 'createLoading', // 局部class名稱
text: text,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0)'
})
return loading
}
<style lang="scss">
.createLoading {
.el-loading-spinner {
top: 50%;
left: 50%;
margin-left: -55px;
background: rgba(0, 0, 0, 0.7);
padding: 20px;
border-radius: 4px;
width: auto;
text-align: center;
position: absolute;
i {
color: #eee;
}
.el-loading-text {
color: #eee;
}
}
}
</style>
到了這里,關于element-ui 自定義loading加載樣式的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!