Adds index to section itterator, for editing

This commit is contained in:
Alicia Sykes 2021-10-24 13:31:13 +01:00
parent 64bd506c91
commit e0a7cbdf96
1 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,7 @@
<Section <Section
v-for="(section, index) in filteredTiles" v-for="(section, index) in filteredTiles"
:key="index" :key="index"
:index="index"
:title="section.name" :title="section.name"
:icon="section.icon || undefined" :icon="section.icon || undefined"
:displayData="getDisplayData(section)" :displayData="getDisplayData(section)"
@ -48,7 +49,9 @@
<div v-if="checkIfResults()" class="no-data"> <div v-if="checkIfResults()" class="no-data">
{{searchValue ? $t('home.no-results') : $t('home.no-data')}} {{searchValue ? $t('home.no-results') : $t('home.no-data')}}
</div> </div>
<!-- Show banner at bottom of screen, for Saving config changes -->
<EditModeSaveMenu v-if="isEditMode" /> <EditModeSaveMenu v-if="isEditMode" />
<!-- Modal for viewing and exporting configuration file -->
<ExportConfigMenu /> <ExportConfigMenu />
</div> </div>
</template> </template>
@ -116,6 +119,7 @@ export default {
// Otherwise, return the usuall data from conf.yml // Otherwise, return the usuall data from conf.yml
return this.sections; return this.sections;
}, },
/* Return all sections, that match users search term */
filteredTiles() { filteredTiles() {
const sections = this.singleSectionView || this.allSections; const sections = this.singleSectionView || this.allSections;
return sections.filter((section) => this.filterTiles(section.items, this.searchValue)); return sections.filter((section) => this.filterTiles(section.items, this.searchValue));