refactor: ♻️ MkGoogle uses local search
This commit is contained in:
parent
f3dc848d6a
commit
72011f8f37
@ -156,7 +156,7 @@ export function toHtml(
|
||||
|
||||
search(node) {
|
||||
const a = doc.createElement("a");
|
||||
a.href = `https://search.annoyingorange.xyz/search?q=${node.props.query}`;
|
||||
a.href = `/search/${node.props.query}`;
|
||||
a.textContent = node.props.content;
|
||||
return a;
|
||||
},
|
||||
|
@ -11,6 +11,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import { i18n } from "@/i18n";
|
||||
import { useRouter } from "@/router";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const props = defineProps<{
|
||||
q: string;
|
||||
@ -19,10 +22,7 @@ const props = defineProps<{
|
||||
const query = ref(props.q);
|
||||
|
||||
const search = () => {
|
||||
window.open(
|
||||
`https://search.annoyingorange.xyz/search?q=${query.value}`,
|
||||
"_blank",
|
||||
);
|
||||
router.push(`/search/${query.value}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user