forked from FoundKeyGang/FoundKey
refactor(client): use composition api
This commit is contained in:
parent
1b867cc1a4
commit
f06ded9433
1 changed files with 11 additions and 24 deletions
|
@ -5,31 +5,18 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from 'vue';
|
import { ref } from 'vue';
|
||||||
import * as os from '@/os';
|
|
||||||
|
|
||||||
export default defineComponent({
|
const props = defineProps<{
|
||||||
props: {
|
q: string;
|
||||||
q: {
|
}>();
|
||||||
type: String,
|
|
||||||
required: true,
|
const query = ref(props.q);
|
||||||
}
|
|
||||||
},
|
const search = () => {
|
||||||
data() {
|
window.open(`https://www.google.com/search?q=${query.value}`, '_blank');
|
||||||
return {
|
|
||||||
query: null,
|
|
||||||
};
|
};
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.query = this.q;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
search() {
|
|
||||||
window.open(`https://www.google.com/search?q=${this.query}`, '_blank');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in a new issue