2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

Fixed more issues reported by vue-migration-helper

This commit is contained in:
Rajesh Akkineni
2016-10-20 09:08:26 +05:30
parent b2c201dde9
commit ee423394e3
5 changed files with 9 additions and 10 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -174,7 +174,7 @@
<div class="dropdown v-select" :class="dropdownClasses"> <div class="dropdown v-select" :class="dropdownClasses">
<div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix" type="button"> <div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix" type="button">
<span class="selected-tag" v-for="(option, index) in valueAsArray" track-by="index"> <span class="selected-tag" v-for="option in valueAsArray" v-bind:key="index">
{{ getOptionLabel(option) }} {{ getOptionLabel(option) }}
<button v-if="multiple" @click="select(option)" type="button" class="close"> <button v-if="multiple" @click="select(option)" type="button" class="close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
@@ -207,7 +207,7 @@
</div> </div>
<ul ref="dropdown-menu" v-show="open" :transition="transition" class="dropdown-menu" :style="{ 'max-height': maxHeight }"> <ul ref="dropdown-menu" v-show="open" :transition="transition" class="dropdown-menu" :style="{ 'max-height': maxHeight }">
<li v-for="(option, index) in filteredOptions" track-by="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index"> <li v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
<a @mousedown.prevent="select(option)"> <a @mousedown.prevent="select(option)">
{{ getOptionLabel(option) }} {{ getOptionLabel(option) }}
</a> </a>
-1
View File
@@ -3,7 +3,6 @@ import vSelect from '../src/components/Select.vue'
Vue.component('v-select', vSelect) Vue.component('v-select', vSelect)
Vue.config.debug = true
Vue.config.devtools = true Vue.config.devtools = true
/* eslint-disable no-new */ /* eslint-disable no-new */
+5 -5
View File
@@ -31,7 +31,7 @@ module.exports = {
pixelsToPointerTop() { pixelsToPointerTop() {
let pixelsToPointerTop = 0 let pixelsToPointerTop = 0
for (let i = 0; i < this.typeAheadPointer; i++) { for (let i = 0; i < this.typeAheadPointer; i++) {
pixelsToPointerTop += this.$els.dropdownMenu.children[i].offsetHeight pixelsToPointerTop += this.$refs.dropdownMenu.children[i].offsetHeight
} }
return pixelsToPointerTop return pixelsToPointerTop
}, },
@@ -50,7 +50,7 @@ module.exports = {
* @returns {number} * @returns {number}
*/ */
pointerHeight() { pointerHeight() {
let element = this.$els.dropdownMenu.children[this.typeAheadPointer] let element = this.$refs.dropdownMenu.children[this.typeAheadPointer]
return element ? element.offsetHeight : 0 return element ? element.offsetHeight : 0
}, },
@@ -60,8 +60,8 @@ module.exports = {
*/ */
viewport() { viewport() {
return { return {
top: this.$els.dropdownMenu.scrollTop, top: this.$refs.dropdownMenu.scrollTop,
bottom: this.$els.dropdownMenu.offsetHeight + this.$els.dropdownMenu.scrollTop bottom: this.$refs.dropdownMenu.offsetHeight + this.$refs.dropdownMenu.scrollTop
} }
}, },
@@ -71,7 +71,7 @@ module.exports = {
* @returns {*} * @returns {*}
*/ */
scrollTo(position) { scrollTo(position) {
return this.$els.dropdownMenu.scrollTop = position return this.$refs.dropdownMenu.scrollTop = position
}, },
} }
} }