Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
183c4c54
Commit
183c4c54
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
get articles
parent
e2d5fc9d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Autocomplete.vue
+25
-32
25 additions, 32 deletions
src/components/Autocomplete.vue
with
25 additions
and
32 deletions
src/components/Autocomplete.vue
+
25
−
32
View file @
183c4c54
...
@@ -62,37 +62,17 @@
...
@@ -62,37 +62,17 @@
select
(
item
)
{
select
(
item
)
{
if
(
item
)
{
if
(
item
)
{
if
(
typeof
item
!=
'
string
'
)
{
if
(
typeof
item
!=
'
string
'
)
{
let
self
=
this
this
.
items
=
[]
/*
this
.
suggesting
=
false
if (item.articles) {
if
(
item
.
article_promise
)
{
axios.get(self.endpoint + 'articles?', {params: {lord: item.match,
item
.
article_promise
.
then
((
response
)
=>
{
dict: self.$parent.lang
}}
)
item
.
article_ids
=
response
.
data
.then(
this
.
submit
(
item
)
function(response) {
}
)
['bob', 'nob'].forEach((dict_tag) => {
}
response.data[dict_tag].forEach((article_id) => {
else
{
let article = {
}
this
.
submit
(
item
)
article.article_id = article_id
article.dictionary = dict_tag
article.match = item.match
item.articles.push(article)
}
)
}
)
}
)
}
}
*/
this
.
items
=
[]
this
.
suggesting
=
false
self
.
$emit
(
'
submit
'
,
item
)
setTimeout
(()
=>
{
self
.
$refs
.
autocomplete
.
$refs
.
input
.
select
()
this
.
items
=
[]
this
.
suggesting
=
false
}
,
1
)
}
}
// If blurred
// If blurred
else
{
else
{
...
@@ -123,7 +103,7 @@
...
@@ -123,7 +103,7 @@
let
hits
=
[]
let
hits
=
[]
response
.
data
.
forEach
((
item
,
i
)
=>
{
response
.
data
.
forEach
((
item
,
i
)
=>
{
let
hit
=
{
q
:
q
,
match
:
item
[
0
],
label
:
item
[
0
],
article
s
:
[]
}
let
hit
=
{
q
:
q
,
match
:
item
[
0
],
label
:
item
[
0
],
article
_promise
:
self
.
get_articles
(
item
[
0
])
}
hit
.
lang
=
item
[
1
]
hit
.
lang
=
item
[
1
]
hits
.
push
(
hit
)
hits
.
push
(
hit
)
...
@@ -132,12 +112,25 @@
...
@@ -132,12 +112,25 @@
hits
.
push
({
q
:
q
,
label
:
q
+
'
'
}
)
hits
.
push
({
q
:
q
,
label
:
q
+
'
'
}
)
self
.
items
=
hits
self
.
items
=
hits
}
}
self
.
loading
=
false
self
.
loading
=
false
}
)
}
)
}
,
}
,
get_articles
(
match
)
{
let
self
=
this
return
axios
.
get
(
self
.
endpoint
+
'
articles?
'
,
{
params
:
{
lord
:
match
,
dict
:
self
.
$parent
.
lang
}}
)
}
,
submit
(
item
)
{
this
.
$emit
(
'
submit
'
,
item
)
let
self
=
this
setTimeout
(()
=>
{
self
.
$refs
.
autocomplete
.
$refs
.
input
.
select
()
this
.
items
=
[]
this
.
suggesting
=
false
}
,
1
)
}
}
,
}
,
}
}
<
/script
>
<
/script
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment