[Vuejs]-Selectpicker class causing problems for me?

0👍

You have given selectpicker to both select tag so it will append options to both select tags.Just change your Jquery code like :

 $('.selectpicker').selectpicker();
    //for category dropdown 
    for (var i = 0; i < Object.keys(e).length; i++) {
      var o = new Option(e[i].name, e[i].name);
      $("#lunchBegins").append(o);
    }
    $("select[name='category']").selectpicker('refresh');


     //for service dropdown, object1 is just dummy
    for (var i = 0; i < Object1.keys(e).length; i++) {
      var o = new Option(e[i].name, e[i].name);
      $("#basic").append(o);
    }
    $("select[name='subcategory']").selectpicker('refresh');

Leave a comment