diff --git a/packages/client/src/components/google.vue b/packages/client/src/components/google.vue index a39168b80f1697a2b3ecce00aa4393bfd38bfa23..210ca72bfe86684eb2bbd2d07b5e2813bf710d11 100644 --- a/packages/client/src/components/google.vue +++ b/packages/client/src/components/google.vue @@ -5,31 +5,18 @@ </div> </template> -<script lang="ts"> -import { defineComponent } from 'vue'; -import * as os from '@/os'; +<script lang="ts" setup> +import { ref } from 'vue'; -export default defineComponent({ - props: { - q: { - type: String, - required: true, - } - }, - data() { - return { - query: null, - }; - }, - mounted() { - this.query = this.q; - }, - methods: { - search() { - window.open(`https://www.google.com/search?q=${this.query}`, '_blank'); - } - } -}); +const props = defineProps<{ + q: string; +}>(); + +const query = ref(props.q); + +const search = () => { + window.open(`https://www.google.com/search?q=${query.value}`, '_blank'); +}; </script> <style lang="scss" scoped>