Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Da qui aggiungo un nuovo elemento
  2. <div class="col-md-6" v-for="feature in this.venues_features" v-if="!checkForAllFeaturesList(feature)">
  3.     <p>
  4.         <span class="btn btn-success btn-xs mr-2" @click="addFeatureFromList(feature)">
  5.             <i class="fa fa-plus" ></i>
  6.         </span>
  7.         {{ feature.name }}
  8.     </p>
  9. </div>
  10.  
  11. // Qui avviene l'aggiunta del nuovo elemento
  12. addFeatureFromList(feature) {
  13.     this.venueFeaturesAvailable.push(feature);
  14.     this.venueFeatures[feature.id] = true;
  15. }
  16.  
  17. // Qui c'è il for che genera gli switch
  18. <div class="col-md-6" v-for="feature in venueFeaturesAvailable" v-if="feature">
  19.     <label class="switch switch-success">
  20.         <input type="checkbox" class="switch-input" v-model="venueFeatures[feature.id]">
  21.         <span class="switch-slider"></span>
  22.     </label>
  23. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement