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> | ||||
| </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> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue