Skip to content

Commit

Permalink
replace Array.from to [].slice.call && remove unused default value
Browse files Browse the repository at this point in the history
  • Loading branch information
DarknessChaser committed Jun 1, 2021
1 parent 29268a3 commit b35545e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/components/theme/basic-tokens-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/input/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit b35545e

Please sign in to comment.