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