Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //lopp
- <div class="col-xs-12 col-md-4">
- <ul class="list-unstyled">
- <li v-for="(repeat, index) in repeats">
- <span class="label label-violet">Powtórzenie @{{ index+1 }}</span>
- <input type="text" v-model="repeat.repeat" :value="repeat.repeat">
- </li>
- </ul>
- </div>
- //app.js
- const app = new Vue({
- el: '#app',
- data: {
- message: 'Hello Vue!',
- selected: '',
- options: [
- { text: '1', value: '1' },
- { text: '2', value: '2' },
- { text: '3', value: '3' },
- { text: '4', value: '4' },
- { text: '5', value: '5' },
- { text: '6', value: '6' },
- { text: '7', value: '7' },
- { text: '8', value: '8' },
- { text: '9', value: '9' },
- { text: '10', value: '10' }
- ],
- repeats: [],
- weights: [],
- times: []
- },
- methods:{
- onSubmit:function(){
- console.log('sssssssssssssssssssssssssssssssss');
- },
- addRow:function(){
- for(i = 0; i < this.selected; i++){
- this.repeats.push({repeat:''});
- this.weights.push({weight:''});
- this.times.push({time:''});
- }
- },
- deleteRow: function(index) {
- this.repeats.splice(index, 1);
- this.weights.splice(index, 1);
- this.times.splice(index, 1);
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement