替换var 为const/let

删除未使用import
替换 == 为 ===
This commit is contained in:
xingyu4j
2022-11-08 13:31:08 +08:00
parent c9e11e7636
commit 011dc23699
66 changed files with 305 additions and 319 deletions

View File

@ -5,7 +5,7 @@
export default {
bind(el, binding, vnode, oldVnode) {
const value = binding.value
if (value == false) return
if (value === false) return
// 获取拖拽内容头部
const dialogHeaderEl = el.querySelector('.el-dialog__header');
const dragDom = el.querySelector('.el-dialog');
@ -16,7 +16,7 @@ export default {
dragDom.style.marginTop = 0;
let width = dragDom.style.width;
if (width.includes('%')) {
width = +document.body.clientWidth * (+width.replace(/\%/g, '') / 100);
width = +document.body.clientWidth * (+width.replace(/%/g, '') / 100);
} else {
width = +width.replace(/\px/g, '');
}
@ -32,12 +32,12 @@ export default {
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
if (sty.left.includes('%')) {
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
styL = +document.body.clientWidth * (+sty.left.replace(/%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/%/g, '') / 100);
} else {
styL = +sty.left.replace(/\px/g, '');
styT = +sty.top.replace(/\px/g, '');
};
}
// 鼠标拖拽事件
document.onmousemove = function (e) {