-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
layoutFloat.vue
79 lines (70 loc) · 1.4 KB
/
layoutFloat.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
<template>
<section>
<div class="layout"
:data-clear="clear" >
<div class="float">
<button-style
id="clear"
:content='clear ? "clearfix" : "no fix"'
@click="toggleClear" />
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis laudantium ea tenetur quas incidunt. Voluptatibus veritatis, rerum vitae illum, recusandae quis. Recusandae quisquam sunt id, eius debitis quos animi hic.
</div>
<div class="next">Next! (not floating)</div>
<div class="last">Last! (floating)</div>
</div>
</section>
</template>
<script>
import ButtonStyle from '~/components/utility/ButtonStyle.vue';
export default {
components: {
ButtonStyle,
},
data() {
return {
clear: false
}
},
methods: {
toggleClear() {
this.clear = !this.clear;
}
},
}
</script>
<style lang="scss" scoped>
.layout {
background: white;
border: 1px solid;
margin: 2em;
padding: 1rem;
}
[data-clear] {
&::after {
background: red;
clear: both;
content: 'this is my clearfix';
display: table;
}
}
.float {
border: 1px solid red;
float: left;
margin-right: 1em;
resize: both;
overflow: auto;
padding: 0.5rem;
}
.next,
.last {
border: 1px solid blue;
margin-bottom: 1em;
padding: 0.5rem;
}
.last {
float: left;
}
button {
font: inherit;
}
</style>