Skip to content

Commit 25ef019

Browse files
committed
Add WIP Vue component
1 parent 35c7671 commit 25ef019

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

docs/source/_assets/js/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ window.anchors = new anchorJS()
55
window.Vue = require('vue')
66

77
Vue.component('responsive-code-sample', require('./components/ResponsiveCodeSample.vue'))
8+
Vue.component('class-table', require('./components/ClassTable.vue'))
89

910
const app = new Vue({
1011
el: '#app'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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>

docs/source/_partials/class-table.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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>
@@ -18,3 +21,4 @@
1821
</tbody>
1922
</table>
2023
</div>
24+
--}}

docs/source/docs/background-color.blade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ features:
2222
$code,
2323
$description,
2424
];
25-
})->all()
25+
})->values()->all()
2626
])
2727

2828
## Hover

0 commit comments

Comments
 (0)