From 0c444f9cc7f9748fd5ec1539fc38b43b2ddbd93d Mon Sep 17 00:00:00 2001 From: Luke Aeschleman Date: Wed, 15 May 2019 17:20:24 -0400 Subject: [PATCH] autocomplete search from side nav --- components/SideNavigation.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/components/SideNavigation.vue b/components/SideNavigation.vue index 8a3bac0d..ef61206c 100644 --- a/components/SideNavigation.vue +++ b/components/SideNavigation.vue @@ -37,7 +37,6 @@ export default { data () { return { - search: '', items: [ { header: 'Player\'s Manual' @@ -144,7 +143,7 @@ } }, computed: { - ...mapGetters(['bookmarkCount', 'getVersion']), + ...mapGetters(['bookmarkCount', 'getVersion', 'phbSearch']), isActive: { get () { return this.$store.state.sidebar @@ -153,14 +152,25 @@ this.$store.commit('toggleSidebar', val) } }, + search: { + get () { + return this.phbSearch + }, + set (val) { + this.setPhbSearch(val) + } + } + }, methods: { ...mapActions(['setPhbSearch']), submit() { - this.setPhbSearch(this.search) this.$router.push({ path: '/phb/search' }) + if (this.$vuetify.breakpoint.mdAndDown) { + this.isActive = false + } } } }