Fork me on GitHub

div中添加el-loading(局部loading的使用)

div 中添加 el-loading(局部 loading 的使用)

效果:在 div 中实现 el-loading

https://img-blog.csdnimg.cn/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);
}
})
},
posted @   毛三仙  阅读(80)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示