Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Add fullPath watcher to differentiate between front page and search results? #116

@SaFrMo

Description

@SaFrMo

I needed to add this to ETC in the watch section on the front page:

'$route.fullPath'(to, from) {
            if (to == '/' && from.includes('?s=')) {
                this.$store.dispatch('LOAD_AND_REPLACE_QUERYDATA', {
                    path: '/'
                })
            } else if (to.includes('?s=') && from == '/') {
                this.$store.dispatch('LOAD_AND_REPLACE_QUERYDATA', {
                    path: to
                })
            }
        }

This ensures that a page's query data is reloaded when switching from the front page (/) to a search results page (?s=search-term) or vice-versa. Without this watcher, moving between those two pages is broken.

I'm adding it on ID10T since I'm running into the same issue there, too, and was wondering if we should just add it to the boilerplate. Thoughts @johndigital @lwaldner @drewbaker ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions