From c2ae160d2326ab2854224cb98811d8fb47e95231 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 27 Oct 2021 23:42:09 +0900 Subject: [PATCH] refactor --- src/client/components/google.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/components/google.vue b/src/client/components/google.vue index 6d8ae0b5bf..be724f038d 100644 --- a/src/client/components/google.vue +++ b/src/client/components/google.vue @@ -10,7 +10,12 @@ import { defineComponent } from 'vue'; import * as os from '@client/os'; export default defineComponent({ - props: ['q'], + props: { + q: { + type: String, + required: true, + } + }, data() { return { query: null, @@ -21,10 +26,7 @@ export default defineComponent({ }, methods: { search() { - const engine = this.$store.state.webSearchEngine || - 'https://www.google.com/search?q={{query}}'; - const url = engine.replace('{{query}}', this.query) - window.open(url, '_blank'); + window.open(`https://www.google.com/search?q=${this.query}`, '_blank'); } } });