summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-01-07 14:44:05 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-01-07 14:44:05 +0900
commitf06ded943397ec10b4c0330cb9ba3bbd33ea7121 (patch)
treee3f530a65cb45d19604c428606256a1497c431bd
parentrefactor(client): use composition api (diff)
downloadmisskey-f06ded943397ec10b4c0330cb9ba3bbd33ea7121.tar.gz
misskey-f06ded943397ec10b4c0330cb9ba3bbd33ea7121.tar.bz2
misskey-f06ded943397ec10b4c0330cb9ba3bbd33ea7121.zip
refactor(client): use composition api
-rw-r--r--packages/client/src/components/google.vue35
1 files changed, 11 insertions, 24 deletions
diff --git a/packages/client/src/components/google.vue b/packages/client/src/components/google.vue
index a39168b80f..210ca72bfe 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>