From 0e514d3c2b6c2835266328bcbca0fda8ea9a841f Mon Sep 17 00:00:00 2001 From: Ruth Wong Date: Mon, 20 Jan 2025 00:50:29 +0800 Subject: [PATCH] Support transpose parameter --- src/App.vue | 2 ++ src/views/HomeView.vue | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index af7e128..6dbab18 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,10 +8,12 @@ import { RouterView } from 'vue-router' const searchParams = new URLSearchParams(location.search); const googleDriveFileId = searchParams.get('googleDriveFileId'); +const transpose = searchParams.get('transpose'); const chordProInput = ref(''); const isLoading = ref(true); provide('chordProInput', chordProInput); provide('isLoading', isLoading); +provide('transpose', transpose); if (googleDriveFileId) { fetch(`https://www.googleapis.com/drive/v3/files/${googleDriveFileId}?alt=media`, { diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index df5b213..9734444 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -92,12 +92,13 @@ const ChordChart = defineAsyncComponent(() => import('../components/ChordChart.v const LoaderBars = defineAsyncComponent(() => import('../components/LoaderBars.vue')); const input = inject('chordProInput'); const isLoading = inject('isLoading'); +const defaultTranspose = inject('transpose'); const caretPosition = ref(0); const columns = ref(1); const fontSize = ref(DEFAULT_FONT_SIZE); const textareaRef = ref(null); -const transposition = ref(0); +const transposition = ref(defaultTranspose); provide('caretPosition', caretPosition);