Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //blade
- <select class="form-control" id="series" v-model="selected" name="series">
- <option>1</option>
- <option>2</option>
- <option>3</option>
- <option>4</option>
- <option>5</option>
- <option>6</option>
- <option>7</option>
- <option>8</option>
- <option>9</option>
- <option>10</option>
- </select>
- <div class="form-group @if ($errors->has('repeat')) has-error @endif">
- <div class="input-group">
- <span class="input-group-addon">
- <label for="repeat" class="label label-primary">
- Powtórzenia
- </label>
- </span>
- <input type="text" name="repeat" class="form-control" placeholder="Ilość powtórzeń" :value="repeats.repeat" >
- </div>
- @if ($errors->has('repeat')) <p class="help-block">{{ $errors->first('repeat') }}</p> @endif
- </div>
- //laravel 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('test');
- },
- 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