This is quite weird but simple :
I have a navbar b-nav
from bootstrap-vue
in which I want to populate dynamic b-nav-item
s.
The template of my vuejs component looks as follow :
<template>
<b-nav vertical class="px-2">
<b-nav-item
v-for="application in applications"
:key="application.id"
to="#">
{{ application.verboseName }}
</b-nav-item>
<b-nav-item :to="{ name: 'BaseSettings' }">
<font-awesome-icon :icon="['fas', 'cogs']" class="fa-fw mr-1"/>
Settings
</b-nav-item>
</b-nav>
</template>
The second b-nav-item
is static but the first one should be populated dynamically with applications
which I retrieve like this in my component :
<script>
// ...
apollo: { applications: INSTALLED_APPLICATIONS_QUERY },
// ...
</script>
The problem is that it doesn't work at all. I've already done other lists populated with graphql retrieved content in other components and it works fine. Furthermore when I try to give some local data to test it :
data () {
return {
apps: [ // used for tests
{ id: '1', verboseName: 'Test1' },
{ id: '2', verboseName: 'Test2' },
{ id: '3', verboseName: 'Test3' },
{ id: '4', verboseName: 'Test4' }
]
}
}
<b-nav vertical class="px-2">
<b-nav-item
v-for="application in apps"
:key="application.id"
to="#">
{{ application.verboseName }}
</b-nav-item>
...
</b-nav>
It works perfectly... And when I try my graphql query on the /graphql interface of my application, it returns desired data correctly too. I admit this time I don't know where to look at ..