From a69d975730e030ceba74afc7a6c509deb36d4646 Mon Sep 17 00:00:00 2001 From: Hex Date: Thu, 21 Sep 2017 06:14:06 -0500 Subject: [PATCH] Loading: update code style (#7152) --- packages/loading/src/directive.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/loading/src/directive.js b/packages/loading/src/directive.js index 61548ff59..6fe2aef59 100644 --- a/packages/loading/src/directive.js +++ b/packages/loading/src/directive.js @@ -1,10 +1,10 @@ import Vue from 'vue'; import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom'; -let Mask = Vue.extend(require('./loading.vue')); +const Mask = Vue.extend(require('./loading.vue')); exports.install = Vue => { if (Vue.prototype.$isServer) return; - let toggleLoading = (el, binding) => { + const toggleLoading = (el, binding) => { if (binding.value) { Vue.nextTick(() => { if (binding.modifiers.fullscreen) { @@ -20,7 +20,7 @@ exports.install = Vue => { el.originalPosition = getStyle(document.body, 'position'); ['top', 'left'].forEach(property => { - let scroll = property === 'top' ? 'scrollTop' : 'scrollLeft'; + const scroll = property === 'top' ? 'scrollTop' : 'scrollLeft'; el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px'; }); ['height', 'width'].forEach(property => { @@ -51,7 +51,7 @@ exports.install = Vue => { } } }; - let insertDom = (parent, el, binding) => { + const insertDom = (parent, el, binding) => { if (!el.domVisible && getStyle(el, 'display') !== 'none' && getStyle(el, 'visibility') !== 'hidden') { Object.keys(el.maskStyle).forEach(property => { el.mask.style[property] = el.maskStyle[property]; @@ -75,7 +75,7 @@ exports.install = Vue => { Vue.directive('loading', { bind: function(el, binding) { - let mask = new Mask({ + const mask = new Mask({ el: document.createElement('div'), data: { text: el.getAttribute('element-loading-text'),