File tree Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ window.anchors = new anchorJS()
5
5
window . Vue = require ( 'vue' )
6
6
7
7
Vue . component ( 'responsive-code-sample' , require ( './components/ResponsiveCodeSample.vue' ) )
8
+ Vue . component ( 'class-table' , require ( './components/ClassTable.vue' ) )
8
9
9
10
const app = new Vue ( {
10
11
el : '#app'
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" border-t border-grey-lighter" >
3
+ <table class =" w-full text-left table-collapse" >
4
+ <thead >
5
+ <tr >
6
+ <th class =" text-sm font-semibold text-grey-darker p-2 bg-grey-lightest" >Class</th >
7
+ <th class =" text-sm font-semibold text-grey-darker p-2 bg-grey-lightest" >Properties</th >
8
+ <th class =" text-sm font-semibold text-grey-darker p-2 bg-grey-lightest" >Description</th >
9
+ </tr >
10
+ </thead >
11
+ <tbody class =" align-baseline" >
12
+ <tr v-for =" (row, i) in visibleRows" >
13
+ <td :class =" i === 0 ? 'border-smoke' : 'border-smoke-light'" class =" p-2 border-t font-mono text-xs text-purple-dark whitespace-no-wrap" >{{ row[0] }}</td >
14
+ <td :class =" i === 0 ? 'border-smoke' : 'border-smoke-light'" class =" p-2 border-t font-mono text-xs text-blue-dark whitespace-pre" >{{ row[1] }}</td >
15
+ <td :class =" i === 0 ? 'border-smoke' : 'border-smoke-light'" class =" p-2 border-t text-sm text-grey-darker" >{{ row[2] }}</td >
16
+ </tr >
17
+ </tbody >
18
+ </table >
19
+ <p class =" text-center py-4" v-show =" !showAll && rows.length > 10" >
20
+ <span role =" button" @click =" showAll = true" class =" text-sm text-blue hover:underline" >Show all {{rows.length}}</span >
21
+ </p >
22
+ </div >
23
+ </template >
24
+
25
+ <script >
26
+ export default {
27
+ props: [' rows' ],
28
+ data () {
29
+ return {
30
+ showAll: false ,
31
+ }
32
+ },
33
+ computed: {
34
+ visibleRows () {
35
+ return this .showAll ? this .rows : this .rows .slice (0 , 10 )
36
+ }
37
+ }
38
+ }
39
+ </script >
Original file line number Diff line number Diff line change 1
- <div class =" border-t border-grey-lighter" >
1
+ <div >
2
+ <class-table :rows =" {{ json_encode ($rows ) } }" ></class-table >
3
+ </div >
4
+ {{-- <div class="border-t border-grey-lighter">
2
5
<table class="w-full text-left table-collapse">
3
6
<thead>
4
7
<tr>
18
21
</tbody>
19
22
</table>
20
23
</div>
24
+ --}}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ features:
22
22
$code,
23
23
$description,
24
24
] ;
25
- })->all()
25
+ })->values()-> all()
26
26
] )
27
27
28
28
## Hover
You can’t perform that action at this time.
0 commit comments