Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
118
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"
  3.                              v-if="!checkForAllFeaturesList(feature)">
  4.                             <p>
  5.                                 <span class="btn btn-success btn-xs mr-2" @click="addFeatureFromList(feature)">
  6.                                     <i class="fa fa-plus" ></i>
  7.                                 </span>
  8.                                 {{ feature.name }}
  9.                             </p>
  10.                         </div>
  11.  
  12. // Qui avviene l'aggiunta del nuovo elemento
  13. addFeatureFromList(feature) {
  14.                 this.venueFeaturesAvailable.push(feature);
  15.                 this.venueFeatures[feature.id] = true;
  16.             }
  17.  
  18. // Qui c'รจ il for che genera gli switch
  19. <div class="col-md-6" v-for="feature in venueFeaturesAvailable" v-if="feature">
  20.                         <label class="switch switch-success">
  21.                             <input type="checkbox" class="switch-input" v-model="venueFeatures[feature.id]">
  22.                             <span class="switch-slider"></span>
  23.                         </label>
  24.                     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement