Skip to content

Commit

Permalink
Merge pull request #16 from imyzt/main
Browse files Browse the repository at this point in the history
pref:Set search title, easier to recognize in multiple tabs
  • Loading branch information
KoriIku authored Oct 9, 2024
2 parents 4706416 + 8ebbd2e commit 344ad44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export default {
script.async = true;
document.head.appendChild(script);
},
setTitle() {
var inputContent = document.getElementsByName('search')[0].value;
document.title = inputContent + ' - Luxirty Search'
},
goHome() {
// 使用 window.location.href 跳转到根路径
window.location.href = '/';
Expand All @@ -46,6 +50,9 @@ export default {
anchor.removeAttribute('data-cturl');
anchor.removeAttribute('data-ctorig');
});
// 设置搜索标题,多页签时更好切换
this.setTitle();
};
// 将回调注册到 Google Custom Search 引擎对象
Expand Down

0 comments on commit 344ad44

Please sign in to comment.