Skip to content

Commit f22ad6e

Browse files
committed
fix: fix docs not remembering key transposed from, fixes #221
1 parent bd2e1c3 commit f22ad6e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

docs/quickstart.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ Was blind, but now I see.
5252
```
5353

5454
<script setup>
55-
import { ref, useTemplateRef} from 'vue'
55+
import { ref, useTemplateRef, watch } from 'vue'
5656

5757
import { transpose, keys } from "@hrgui/chord-charts";
5858

5959

6060
const count = ref(0)
61-
const originalKey = 'D';
61+
const previousKey = ref('D')
6262
const currentKey = ref('D')
6363

6464
const text = ref(`
@@ -72,8 +72,10 @@ const text = ref(`
7272
Was blind, but now I see.
7373
`);
7474

75-
function transposeChordChart() {
76-
text.value = transpose(text.value, originalKey, currentKey.value);
75+
76+
function transposeChordChart(e) {
77+
text.value = transpose(text.value, previousKey.value, e.target.value);
78+
previousKey.value = e.target.value;
7779
}
7880

7981
</script>

0 commit comments

Comments
 (0)