feay: 添加 loading
This commit is contained in:
@@ -1,5 +1,25 @@
|
||||
// https://github.com/loadingio/css-spinner/tree/master/dist 从当前链接现在在 在tools.js 的myLoading 进行判断处理
|
||||
// 高度 宽度 等细节 记得处理
|
||||
.my-loading-parent--relative {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative !important;
|
||||
}
|
||||
.my-loading-box {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative !important;
|
||||
}
|
||||
.my-loading{
|
||||
position: absolute;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: 0;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
loading-hide{
|
||||
display: none;
|
||||
|
||||
@@ -340,7 +340,7 @@ export default {
|
||||
route += 'asset'
|
||||
} else {
|
||||
tableId = type + 'Table'
|
||||
route += 'monitor/' + type
|
||||
route += type
|
||||
}
|
||||
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + tableId)
|
||||
if (!(pageSize && pageSize !== 'undefined')) {
|
||||
|
||||
@@ -146,7 +146,13 @@ function myLoadingFunction (el, binding, vnode) {
|
||||
// div内部加入内容
|
||||
// div.innerHTML = '加载中...'
|
||||
// el 元素设置相对定位 div设置绝对定位
|
||||
el.setAttribute('class', 'el-loading-parent--relative')
|
||||
console.log(el.className)
|
||||
const elClassname = el.className.split(' ')
|
||||
if (elClassname.indexOf('my-loading-parent--relative') === -1) {
|
||||
className.push('my-loading-parent--relative')
|
||||
el.className = className.join(' ')
|
||||
}
|
||||
// el.setAttribute('class', 'el-loading-parent--relative')
|
||||
// 设置绝对定位
|
||||
div.setAttribute('class', className)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user