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()
55window . Vue = require ( 'vue' )
66
77Vue . component ( 'responsive-code-sample' , require ( './components/ResponsiveCodeSample.vue' ) )
8+ Vue . component ( 'class-table' , require ( './components/ClassTable.vue' ) )
89
910const app = new Vue ( {
1011 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">
25 <table class="w-full text-left table-collapse">
36 <thead>
47 <tr>
1821 </tbody>
1922 </table>
2023</div>
24+ --}}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ features:
2222 $code,
2323 $description,
2424 ] ;
25- })->all()
25+ })->values()-> all()
2626] )
2727
2828## Hover
You can’t perform that action at this time.
0 commit comments