Skip to content

Commit 1da923a

Browse files
committed
Creating hidden component
1 parent 197cc20 commit 1da923a

File tree

4 files changed

+72
-6
lines changed

4 files changed

+72
-6
lines changed

docs/App.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<template>
22
<main>
33
<div class="title">
4-
<img
5-
alt="Vue Framework"
6-
src="https://vuejs.org/images/logo.png"
7-
width="200"
8-
/>
4+
<img alt="Vue Framework" src="https://vuejs.org/images/logo.png" width="200" />
95
<h1>Vue Grid Responsive</h1>
106
</div>
117
<br />

docs/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import 'vue-code-highlight/themes/duotone-sea.css';
22

33
import Vue from 'vue';
44
import { component as VueCodeHighlight } from 'vue-code-highlight';
5-
import { Row, Column } from '../src';
5+
import { Row, Column, Hidden } from '../src';
66
import App from './App.vue';
77

88
Vue.component('row', Row);
99
Vue.component('column', Column);
10+
Vue.component('hidden', Hidden);
1011
Vue.component('code-highlight', VueCodeHighlight);
1112

1213
new Vue({

src/Hidden.vue

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<template>
2+
<div :class="classGeneral">
3+
<slot />
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'Hidden',
10+
data() {
11+
return {
12+
classGeneral: `${this.createClassSize()}`
13+
};
14+
},
15+
props: {
16+
xs: Boolean,
17+
sm: Boolean,
18+
md: Boolean,
19+
lg: Boolean,
20+
xl: Boolean
21+
},
22+
methods: {
23+
createClassSize() {
24+
let newClass = '';
25+
26+
newClass += this.xs ? 'hiddenVGR-xs ' : '';
27+
newClass += this.sm ? 'hiddenVGR-sm ' : '';
28+
newClass += this.md ? 'hiddenVGR-md ' : '';
29+
newClass += this.lg ? 'hiddenVGR-lg ' : '';
30+
newClass += this.xl ? 'hiddenVGR-xl ' : '';
31+
32+
return newClass;
33+
}
34+
}
35+
};
36+
</script>
37+
38+
<style scoped>
39+
@media (max-width: 575px) {
40+
.hiddenVGR-xs {
41+
display: none;
42+
}
43+
}
44+
45+
@media (min-width: 576px) and (max-width: 767px) {
46+
.hiddenVGR-sm {
47+
display: none;
48+
}
49+
}
50+
51+
@media (min-width: 768px) and (max-width: 991px) {
52+
.hiddenVGR-md {
53+
display: none;
54+
}
55+
}
56+
57+
@media (min-width: 992px) and (max-width: 1199px) {
58+
.hiddenVGR-lg {
59+
display: none;
60+
}
61+
}
62+
63+
@media (min-width: 1200px) {
64+
.hiddenVGR-xl {
65+
display: none;
66+
}
67+
}
68+
</style>

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { default as Row } from './Row.vue';
22
export { default as Column } from './Column.vue';
3+
export { default as Hidden } from './Hidden.vue';

0 commit comments

Comments
 (0)