forked from ivansieder-xx/vuejs-basic-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-components.html
46 lines (38 loc) · 998 Bytes
/
10-components.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
<!doctype html>
<meta charset="UTF-8">
<title>Vue.js demo</title>
<script src="https://unpkg.com/vue"></script>
<div id="demo">
<login-form></login-form>
<login-form></login-form>
<login-form></login-form>
<login-form></login-form>
<login-form></login-form>
<login-form></login-form>
</div>
<script>
Vue.component('login-form', {
template: `
<div>
<label for="email">eMail: </label>
<input type="email">
<br>
<label for="password">Password: </label>
<input type="password">
<br>
<button>Log in</button>
</div>
`
})
const vm = new Vue({
el: '#demo',
data: {
currentView: 'login-form'
},
methods: {
loginDone() {
this.currentView = 'welcome-area'
}
}
})
</script>