-
Notifications
You must be signed in to change notification settings - Fork 1
/
template1.html
97 lines (95 loc) · 2.91 KB
/
template1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
<div id="app">
<v-app>
<template>
<v-container>
<v-layout row v-for="(additional, index) in additionals">
<v-flex xs4>
<v-form >
<v-text-field
name="Number"
label="Number"
v-model="additional.number"
number
id="additional.number"
required
></v-text-field>
</v-form>
</v-flex>
<v-flex xs4 offset-xs1>
<v-form>
<v-select
label="Reason"
name="Reason"
v-model="additional.reason"
select
id="additional.reason"
:items="items"
required
></v-select>
</v-form>
</v-flex>
<v-icon light left class="ml-3 remove" style="display:none" color="red darken-3" v-on:click="removeAdditional(index)">remove_circle</v-icon>
</v-layout>
<v-layout
fixed
bottom
right
>
<v-btn
fab
dark
color="teal"
v-on:click="addNewAdditional">
<v-icon dark>add</v-icon>
</v-btn>
<v-btn
fab
dark
color="cyan"
v-on:click="editAdditional">
<v-icon dark>edit</v-icon>
</v-btn>
</v-layout>
</v-container>
</template>
</v-app>
</div>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vuetify/dist/vuetify.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script>
new Vue({
el: '#app',
data:{
items:["Reason 1","Reason 2","Reason 3"],
additional:{
number:'',
reason:''
},
additionals:[]
},
methods: {
addNewAdditional: function () {
$('.remove').hide()
this.additionals.push(Vue.util.extend({}, this.additional))
},
removeAdditional: function (index) {
Vue.delete(this.additionals, index);
},
editAdditional: function(){
$('.remove').toggle()
}
}
})
</script>
</body>
</html>