yuche / vue-strap

Bootstrap components built with Vue.js
http://yuche.github.io/vue-strap/
MIT License
4.71k stars 929 forks source link

fix multiple select bug #380

Closed hejianxian closed 8 years ago

hejianxian commented 8 years ago

hi!

I found something wrong in multiple select component, about set the selected status.

if 'value' = 0 or = false, etc. It can't be selected. 👀 ⬇️

In 'Select.vue' file,

  <span class="glyphicon glyphicon-ok check-mark" v-show="isSelected(option[optionsValue] || option)"></span>

this option[optionsValue] || option will return 'option', and then.

In this method, will return false.

isSelected (v) {
   return this.values.indexOf(v) > -1
}

so! I remove the '|| option'. Because we would not care the argument of 'indexOf()', it will automatically be 'string'.