[Vuejs]-Vue Js: selectpicker(''refresh") not working

0👍

If you’re using Vue 2, you might need to use nextTick in mounted hook.

According to Vue.js document:

Note that mounted does not guarantee that all child components have also been mounted. If you want to wait until the entire view has been rendered, you can use vm.$nextTick inside of mounted:

mounted: function () {
  this.$nextTick(function () {
    // Code that will run only after the
    // entire view has been rendered
  })
}
👤wxsm

0👍

I faced the same problem where select inputs were modified by vue.js and thus they were conflicting. For me the solution was this:

updated() {
    $('.bSelect').selectpicker({
        liveSearch: true,
        size: 10
    });
    $('.bSelect').selectpicker('refresh');
}

Leave a comment