添加store

This commit is contained in:
zyronon
2023-08-04 18:47:16 +08:00
parent 4d72b95ece
commit 8a18bb53fd
6 changed files with 625 additions and 11 deletions

View File

@@ -14,18 +14,11 @@ import correct from './assets/sound/correct.wav'
import {chunk} from "lodash"
import {$ref} from "vue/macros"
import {useSound} from "@/hooks/useSound.ts"
import {useBaseStore} from "@/stores/base.ts"
import {Config, Word} from "@/types.ts"
// import {$ref, $computed} from 'vue/macros'
// import MCE_3 from './assets/dicts/NCE_3.json'
type Config = {
newWords: Word[],
skipWords: Word[],
skipWordNames: string[],
dict: string,
chapterIndex: number,
wordIndex: number,
}
type Word = {"name": string, "usphone": string, "ukphone": string, "trans": string[]}
let wordList: Word[][] = $ref([])
let input = $ref('')
let wrong = $ref('')
@@ -39,6 +32,8 @@ let config: Config = $ref({
wordIndex: 0,
})
const store = useBaseStore()
// const [play, setAudio] = useSound([机械0, 机械1, 机械2, 机械3], 1)
const [play, setAudio] = useSound([老式机械], 3)
// const [play, setAudio] = useSound([电话打字的声音Mp3], 3)