Skip to content
Snippets Groups Projects
Commit 80e83fed authored by Henrik Askjer's avatar Henrik Askjer
Browse files

add scope select

parent bd892c8a
No related branches found
No related tags found
No related merge requests found
<template> <template>
<v-container color="tertiary" depressed flat> <v-container fluid>
<v-row align="center" justify="center"> <v-row >
<v-col> <v-col>
<v-select rounded
v-model="pos_selected"
hide-details
outlined
dense
:items="pos_items"
@input="updatePos">
</v-select>
</v-col>
<v-col>
<v-select rounded <v-select rounded
v-model="selected" v-model="scope_selected"
hide-details="" hide-details=""
outlined outlined
dense dense
:items="items" :items="scope_items"
@input="updatePos"> @input="updatePos">
</v-select> </v-select>
</v-col> </v-col>
<v-col> </v-row>
<v-switch label="Fritekstsøk"/> </v-container>
</v-col>
</v-row>
</v-container>
</template> </template>
<script> <script>
...@@ -25,17 +33,35 @@ export default { ...@@ -25,17 +33,35 @@ export default {
name: "SearchToolbar", name: "SearchToolbar",
data() { data() {
return { return {
selected: {text: this.$t("pos.ALL") , value: "ALL"}, pos_selected: {text: this.$t("pos.ALL") , value: "ALL"},
items: ["ALL", "NOUN", "PRON","DET","ADJ","CCONJ","SCONJ", "ADV", "VERB", "INTJ"].map((text) =>{ pos_items: ["ALL", "NOUN", "PRON","DET","ADJ","CCONJ","SCONJ", "ADV", "VERB", "INTJ"].map(text =>{
return {text: this.$t("pos." + text ), value: text} return {text: this.$t("pos." + text ), value: text}
}),
scope_selected: {text: this.$t("scope.w"), value: "w"},
scope_items: ["w", "f", "wf"].map(text => {
return {text: this.$t("scope." + text), value: text}
}) })
} }
}, },
methods: { methods: {
updatePos (pos) { updatePos (pos) {
console.log("UPDATE", pos)
this.$emit('updatePos', pos == 'ALL' ? null : pos) this.$emit('updatePos', pos == 'ALL' ? null : pos)
},
updateScope (scope) {
this.$emit('updateScope', scope)
} }
} }
} }
</script> </script>
<style scoped>
.container {
padding: 10px !important;
margin-top: 10px;
min-width: 100%;
}
</style>
...@@ -38,5 +38,10 @@ ...@@ -38,5 +38,10 @@
"ADP": "preposisjon", "ADP": "preposisjon",
"VERB": "verb", "VERB": "verb",
"INTJ": "interjeksjon" "INTJ": "interjeksjon"
},
"scope": {
"w": "lemmasøk",
"f": "fritekstsøk",
"wf": "lemmasøk + fritekstsøk"
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment