Refactor schedule view to improve PDF generation and enhance element referencing
Updated ScheduleView.vue to replace direct DOM querying with Vue's ref system for better maintainability. The 'flex-item' div now uses a reference for PDF generation, improving code clarity and performance. This change aligns with best practices in Vue component design.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<li v-if="leagues.length === 0" class="no-leagues">Keine Ligen für diese Saison gefunden</li>
|
||||
</ul>
|
||||
|
||||
<div class="flex-item">
|
||||
<div class="flex-item" ref="scheduleContainer">
|
||||
<!-- Tab Navigation - nur anzeigen wenn Liga ausgewählt -->
|
||||
<div v-if="selectedLeague && selectedLeague !== ''" class="tab-navigation">
|
||||
<button
|
||||
@@ -625,7 +625,7 @@ export default {
|
||||
return club ? club.name : '';
|
||||
},
|
||||
async generatePDF() {
|
||||
const element = this.$el.querySelector('.flex-item > div');
|
||||
const element = this.$refs.scheduleContainer;
|
||||
const highlightName = this.getCurrentClubName();
|
||||
if (element) {
|
||||
const pdfGen = new PDFGenerator();
|
||||
|
||||
Reference in New Issue
Block a user