div 中添加 el-loading(局部 loading 的使用)
效果:在 div 中实现 el-loading
/i/ll/?i=c2870e74bd344b06ad1ccb0844b8e8ce.png
<div class="content-main">
{{ hotList }}
</div>
getHotList(columnType) {
this.$nextTick(() => {
var loading = this.$loading({
lock: true,
text: "努力加载中...",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.5)",
target: document.querySelector(".content-main") // 替换成你的类名
});
try {
getPolicyList({columnType, pageNum: 1, pageSize: 10}).then(res15 => {
this.hotList = res15.data.rows
}).finally(() => {
loading.close();
})
} catch (error) {
console.error(error);
}
})
},
标签:el,loading,添加,error,div,res15
From: https://www.cnblogs.com/ProgrammerMao-001/p/18342756