Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit c7f9f53

Browse files
authored
Merge pull request #190 from kodadot/search
search
2 parents 5a7aea4 + 09e73d1 commit c7f9f53

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dashboard/src/components/rmrk/Gallery/Search/SearchBar.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ import { Debounce } from 'vue-debounce-decorator';
1717
export default class SearchBar extends Vue {
1818
@Prop() public query!: string;
1919
20+
public mounted() {
21+
if (this.$route.query.search && typeof this.$route.query.search === 'string') {
22+
this.update(this.$route.query.search)
23+
}
24+
}
25+
2026
2127
get searchQuery() {
2228
return this.query
2329
}
2430
2531
set searchQuery(value: string) {
32+
this.replaceUrl(value)
2633
this.update(value)
2734
}
2835
@@ -33,5 +40,12 @@ export default class SearchBar extends Vue {
3340
return value
3441
}
3542
43+
@Debounce(400)
44+
replaceUrl(value: string) {
45+
if (this.query != value) {
46+
this.$router.replace({ name: "nft", query: {search: value} })
47+
}
48+
}
49+
3650
}
3751
</script>

0 commit comments

Comments
 (0)