twitch-bot/internal/actors/quotedb/list.js
Knut Ahlers 4ead12f536
[quotedb] Add simple page to list quotes
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2021-10-22 22:27:25 +02:00

26 lines
407 B
JavaScript

new Vue({
computed: {
quoteItems() {
return this.quotes.map((q, i) => ({ id: i + 1, quote: q }))
},
},
data: {
fields: [
{ key: 'id', label: 'ID', sortable: true, sortDirection: 'desc' },
{ key: 'quote' },
],
quotes: [],
},
el: '#app',
mounted() {
axios.get(window.location.href)
.then(res => {
this.quotes = res.data
})
},
})