File tree Expand file tree Collapse file tree 6 files changed +72
-3
lines changed Expand file tree Collapse file tree 6 files changed +72
-3
lines changed Original file line number Diff line number Diff line change 1515 - [ List] ( presets.md?id=list )
1616 - [ Bullet List] ( presets.md?id=bullet-list )
1717 - [ Twitch] ( presets.md?id=twitch )
18+ - [ Table] ( presets.md?id=table )
1819
1920- Development
2021 - [ Getting started] ( development.md?id=development )
Original file line number Diff line number Diff line change 5151 <vcl-twitch :primary="props.primary" :secondary="props.secondary" />
5252 </template >
5353</color-switch >
54+
55+ ### Table
56+
57+ | Custom Prop | Type | Default | Description |
58+ | :-----------:| :-------:| :-------:| :-----------------:|
59+ | rows | Number | 5 | Number of rows |
60+ | columns | Number | 4 | Number of columns |
61+
62+ <color-switch >
63+ <template slot-scope =" props " >
64+ <vcl-table :primary="props.primary" :secondary="props.secondary" :rows="5" :columns="4" />
65+ </template >
66+ </color-switch >
Original file line number Diff line number Diff line change 1+ <script >
2+ import VueContentLoading from ' ../VueContentLoading.vue' ;
3+
4+ export default {
5+ components: {
6+ VueContentLoading,
7+ },
8+
9+ props: {
10+ header: {
11+ default: true ,
12+ type: Boolean ,
13+ },
14+ rows: {
15+ default: 5 ,
16+ type: Number ,
17+ },
18+ columns: {
19+ default: 4 ,
20+ type: Number ,
21+ },
22+ },
23+
24+ computed: {
25+ height () {
26+ return (this .rows * 30 ) - 20 ;
27+ },
28+ width () {
29+ return ((this .columns - 1 ) * 20 ) + 10 + (this .columns * 100 );
30+ },
31+ },
32+
33+ methods: {
34+ getXPos (column ) {
35+ return 5 + ((column - 1 ) * 100 ) + ((column - 1 ) * 20 );
36+ },
37+ getYPos (row ) {
38+ return (row - 1 ) * 30 ;
39+ },
40+ },
41+ };
42+ </script >
43+
44+ <template >
45+ <vue-content-loading v-bind =" $attrs" :width =" width" :height =" height" >
46+ <template v-for =" r in rows " >
47+ <template v-for =" c in columns " >
48+ <rect :key =" r + '_' + c" :x =" getXPos(c)" :y =" getYPos(r)" rx =" 3" ry =" 3" :width =" 100" height =" 10" />
49+ </template >
50+ <rect :key =" r + '_l'" v-if =" r < rows" x =" 0" :y =" getYPos(r) + 20" :width =" width" height =" 1" />
51+ </template >
52+ </vue-content-loading >
53+ </template >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import VclTwitch from '../components/presets/Twitch.vue';
66import VclFacebook from '../components/presets/Facebook.vue' ;
77import VclInstagram from '../components/presets/Instagram.vue' ;
88import VclBulletList from '../components/presets/BulletList.vue' ;
9+ import VclTable from '../components/presets/Table.vue' ;
910
1011export default VueContentLoading ;
1112
@@ -16,5 +17,6 @@ export {
1617 VclFacebook ,
1718 VclInstagram ,
1819 VclBulletList ,
20+ VclTable ,
1921 VueContentLoading ,
2022} ;
You can’t perform that action at this time.
0 commit comments