This repository has been archived by the owner on Apr 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathDemo.vue
120 lines (103 loc) · 2.24 KB
/
Demo.vue
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<template>
<div>
<div class="container">
<float-label>
<input type="text" placeholder="First name">
</float-label>
<float-label>
<input type="email" placeholder="Email" v-model="email">
</float-label>
<float-label label="Overridden label">
<input type="password" placeholder="Password">
</float-label>
<float-label :on="isActive">
<input type="text" placeholder="Inactive">
</float-label>
<float-label>
<textarea placeholder="Comment"></textarea>
</float-label>
<float-label :dispatch="false">
<select>
<option disabled selected>Framework</option>
<option>Vue</option>
<option>React</option>
<option>Angular</option>
<option>Ember</option>
</select>
</float-label>
<float-label label="Version">
<select v-model="version">
<option v-for="option in options" :value="option.value">
{{ option.text }}
</option>
</select>
</float-label>
<float-label fixed>
<input type="text" placeholder="Fixed">
</float-label>
<div class="example">
<float-label>
<input type="text" placeholder="Website">
</float-label>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'demo',
data () {
return {
email: '[email protected]',
version: 'beta',
options: [
{ value: 'alpha', text: 'Alpha' },
{ value: 'beta', text: 'Beta' },
{ value: 'stable', text: 'Stable' },
]
}
},
computed: {
isActive () {
return false
}
}
}
</script>
<style>
.container {
width: 150px;
margin: auto;
}
body {
padding: 2em;
}
input,
textarea,
select {
margin-bottom: 2em;
line-height: 1.15;
font-size: 14px;
padding: .4em;
width: 100%;
}
.example .vfl-label {
text-transform: uppercase;
}
.example .vfl-label-on-input {
top: -1em;
}
.example .vfl-label-on-focus {
color: #ff851b;
}
.example .vfl-label + input {
padding-left: 0;
font-size: 100%;
border: 0;
border-bottom: 2px solid #aaa;
transition: border 0.2s;
}
.example .vfl-label-on-focus + input {
border-bottom: 2px solid #ff851b;
}
</style>