Merge branch 'main' of https://github.com/KoriIku/luxirty-search
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
KoriIku 2024-10-11 14:49:24 +08:00
commit e4ab1d52ec
2 changed files with 9 additions and 3 deletions

View File

@ -21,9 +21,13 @@
<script>
export default {
name: 'SearchPage',
props: ['query'],
mounted() {
this.loadGoogleCSE();
this.setupResultsRenderedCallback(); //
if (!this.query) {
this.goHome();
}
},
methods: {
loadGoogleCSE() {
@ -44,7 +48,7 @@ export default {
//
const myWebResultsRenderedCallback = () => {
const links = document.querySelectorAll('a.gs-title');
links.forEach((anchor) => {
// 'data-cturl' 'data-ctorig'
anchor.removeAttribute('data-cturl');
@ -92,7 +96,8 @@ export default {
color: #58636f;
margin-right: 20px;
white-space: nowrap;
user-select: none; /* 防止标题文字被选中 */
user-select: none;
/* 防止标题文字被选中 */
}
/* 针对小屏幕的样式 */

View File

@ -14,7 +14,8 @@ const router = createRouter({
{
path: '/search',
name: 'Results',
component: Results
component: Results,
props: route => ({ query: route.query.q })
}
]
})