Skip to content
Snippets Groups Projects
Commit 20a41e08 authored by schneider210's avatar schneider210
Browse files

fix: display error message for empty search and search containing whitespace only

parent f5010e73
Branches
Tags
1 merge request!56no-search-result
......@@ -2,12 +2,13 @@
<div>
<v-alert
border="left"
colored-border
color="red accent-4"
colored-border
elevation="2"
>
>
<!-- TODO: provide translation -->
No search results found for <code>{{ query }}</code>
<span v-if="validQuery">Please enter a valid search term.</span>
<span v-else>No search results found for <code>{{ query }}</code></span>
</v-alert>
</div>
</template>
......@@ -20,8 +21,10 @@ export default {
default: () => '',
},
},
computed: {
validQuery() {
return !this.query.match(/\b\s*\b/);
},
},
};
</script>
<style lang="scss" scoped>
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment