fix: fix search hit

This commit is contained in:
Justineo 2021-08-24 14:50:43 +08:00
parent cd5896799b
commit ebc5b856d7
No known key found for this signature in database
GPG Key ID: B73F0979CF18A0EA

View File

@ -70,14 +70,14 @@ export default {
facetFilters: [`lang:${locale}`]
},
navigator: {
navigate ({ suggestionUrl }) {
navigate: ({ itemUrl }) => {
const { pathname: hitPathname } = new URL(
window.location.origin + suggestionUrl
window.location.origin + itemUrl
)
if (this.$router.history.current.path === hitPathname) {
window.location.assign(window.location.origin + suggestionUrl)
window.location.assign(window.location.origin + itemUrl)
} else {
this.$router.push(suggestionUrl)
this.$router.push(itemUrl)
}
}
},