vue.js - How to disable v-select options dynamically in Vuejs -


i'm trying build application on vuejs 2.0 i'm having following codes

<div class="col-sm-6">     <label class="col-sm-6 control-label">with client*:</label>     <div class="radio col-sm-3">         <input type="radio" name="with_client" v-model="withclient" value="1" checked="">         <label>             yes         </label>     </div>     <div class="radio col-sm-3">         <input type="radio" name="with_client" v-model="withclient" value="0">         <label>             no         </label>     </div> </div> 

i want disable v-select i.e. http://sagalbot.github.io/vue-select/ element if v-model withclient = 0 , enable withclient= 1

<v-select multiple :options="contacts" :on-search="getoptions" placeholder="contact name" v-model="contactparticipants"></v-select> 

if "disabled" not yet supported, it's pretty easy add your own:

  <style>     .disabled {       pointer-events:none;       color: #bfcbd9;       cursor: not-allowed;       background-image: none;       background-color: #eef1f6;       border-color: #d1dbe5;        }   </style>  <v-select :options="['foo','bar','baz', 'hello']" v-bind:class="{ disabled: true }"></v-select> 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -