replace Array.from to [].slice.call && remove unused default value

pull/21039/head
DarknessChaser 2021-06-01 17:21:18 +08:00
parent 29268a3d4a
commit b35545e140
2 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ export default {
bus.$on(ACTION_USER_CONFIG_UPDATE, this.setGlobal);
bus.$on(ACTION_COMPONECT_SELECT, (val) => {
this.$nextTick(() => {
const getSelectElement = Array.from(document.querySelectorAll('h4')).filter((el) => (el.innerText.toLowerCase() === val));
const getSelectElement = [].slice.call(document.querySelectorAll('h4')).filter((el) => (el.innerText.toLowerCase() === val));
if (getSelectElement[0]) {
const elementTop = getSelectElement[0].getBoundingClientRect().top;
window.scrollTo(0, window.pageYOffset + elementTop - 20); // 20 for padding

View File

@ -370,7 +370,7 @@
this.$emit('change', event.target.value);
},
calcIconOffset(place) {
let elList = [].slice.call(this.$el.querySelectorAll(`.el-input__${place}`) || []);
let elList = [].slice.call(this.$el.querySelectorAll(`.el-input__${place}`));
if (!elList.length) return;
let el = null;
for (let i = 0; i < elList.length; i++) {