[Client] Resolve #2951

あと検索フォームでサジェストを有効に
This commit is contained in:
syuilo
2018-12-16 08:45:10 +09:00
parent 2faa58928f
commit b7c5c71c6f
7 changed files with 31 additions and 18 deletions

View File

@ -100,7 +100,15 @@ export default Vue.extend({
input: true
}).then(({ canceled, result: query }) => {
if (canceled) return;
this.$router.push(`/search?q=${encodeURIComponent(query)}`);
const q = query.trim();
if (q.startsWith('@')) {
this.$router.push(`/${q}`);
} else if (q.startsWith('#')) {
this.$router.push(`/tags/${encodeURIComponent(q.substr(1))}`);
} else {
this.$router.push(`/search?q=${encodeURIComponent(q)}`);
}
});
},