refactor
This commit is contained in:
parent
9c74c5c5dc
commit
c2ae160d23
@ -10,7 +10,12 @@ import { defineComponent } from 'vue';
|
|||||||
import * as os from '@client/os';
|
import * as os from '@client/os';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: ['q'],
|
props: {
|
||||||
|
q: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
query: null,
|
query: null,
|
||||||
@ -21,10 +26,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
const engine = this.$store.state.webSearchEngine ||
|
window.open(`https://www.google.com/search?q=${this.query}`, '_blank');
|
||||||
'https://www.google.com/search?q={{query}}';
|
|
||||||
const url = engine.replace('{{query}}', this.query)
|
|
||||||
window.open(url, '_blank');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user