yumechi-no-kuni/src/client/app/common/views/deck/deck.search-column.vue

48 lines
781 B
Vue
Raw Normal View History

<template>
<x-column>
2019-02-17 20:13:56 -06:00
<template #header>
<fa icon="search"/><span>{{ q }}</span>
2019-02-17 18:48:00 -06:00
</template>
<div>
2019-05-20 13:07:11 -05:00
<x-notes ref="timeline" :pagination="pagination" @inited="() => $emit('loaded')"/>
</div>
</x-column>
</template>
<script lang="ts">
import Vue from 'vue';
import XColumn from './deck.column.vue';
import XNotes from './deck.notes.vue';
2019-04-24 17:46:39 -05:00
import { genSearchQuery } from '../../../common/scripts/gen-search-query';
export default Vue.extend({
components: {
XColumn,
XNotes
},
data() {
return {
2019-05-20 13:07:11 -05:00
pagination: {
endpoint: 'notes/search',
limit: 20,
params: () => genSearchQuery(this, this.q)
}
};
},
computed: {
q(): string {
return this.$route.query.q;
}
},
watch: {
$route() {
this.$refs.timeline.reload();
}
},
});
</script>