1.效果图
2.自定义loading代码
<template>
<div>
<div id="loadingDiv"></div>
<el-button @click="test()">测试</el-button>
</div>
</template>
import { Loading } from 'element-ui';
<script>
export default {
data() {
return {
loading: undefined
};
},
methods: {
test(){
this.loading = Loading.service({
lock: true,
text: '上传中...',
// background: 'rgba(0, 0, 0, 0.7)',
target: document.querySelector('#loadingDiv')
})
},
endLoading() {
this.loading.close()
}
}
}