Skip to content

Commit 31119f7

Browse files
author
Nathan Reyes
authored
Merge pull request #24 from LucaRainone/master
Use local nextTick reference, deleting Vue scope dependency
2 parents 5efe965 + 46e7d3a commit 31119f7

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/components/CalendarPane.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@
144144
</template>
145145

146146
<script>
147-
import Vue from 'vue';
148147
import CalendarWeeks from './CalendarWeeks';
149148
import CalendarNav from './CalendarNav';
150149
import Popover from './Popover';
@@ -391,7 +390,7 @@ export default {
391390
},
392391
preloadPages() {
393392
// Load the next and previous pages
394-
Vue.nextTick(() => {
393+
this.$nextTick(() => {
395394
this.loadPage(this.page_.prevMonthComps);
396395
this.loadPage(this.page_.nextMonthComps);
397396
this.pages = this.pages.filter(p => p.loaded);

src/components/DatePicker.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
</template>
5151

5252
<script>
53-
import Vue from 'vue';
5453
import Popover from './Popover';
5554
import SingleDatePicker from './SingleDatePicker';
5655
import MultipleDatePicker from './MultipleDatePicker';
@@ -215,7 +214,7 @@ export default {
215214
this.updateInputValue();
216215
},
217216
updateInputValue() {
218-
Vue.nextTick(() => { this.inputValue = this.profile.formatValue(this.value, this.dragValue); });
217+
this.$nextTick(() => { this.inputValue = this.profile.formatValue(this.value, this.dragValue); });
219218
},
220219
},
221220
};

src/components/Popover.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
</template>
4343

4444
<script>
45-
import Vue from 'vue';
4645
import defaults from '../utils/defaults';
4746
import { ancestorElements } from '../utils/helpers';
4847
import { POPOVER_VISIBILITIES as VISIBILITIES } from '../utils/constants';
@@ -174,7 +173,7 @@ export default {
174173
if (this.visibility === VISIBILITIES.FOCUS) {
175174
// Trap focus if element losing focus is nested within the popover content
176175
if (e.target !== this.$refs.popover && ancestorElements(e.target).includes(this.$refs.popoverContent)) {
177-
Vue.nextTick(() => this.$refs.popover.focus());
176+
this.$nextTick(() => this.$refs.popover.focus());
178177
}
179178
this.visibleManaged = false;
180179
}

0 commit comments

Comments
 (0)