This commit is contained in:
zyronon
2023-10-23 00:34:16 +08:00
parent 5a52e25682
commit 5922475b33
2 changed files with 40 additions and 26 deletions

View File

@@ -79,15 +79,15 @@ let allList = $ref([])
const word = $computed(() => {
let w = data.words[data.index]
let s = allList.find(s => s.name === w.name)
if (s) return s
else return w ?? {
trans: [],
name: '',
usphone: '',
ukphone: '',
}
// let w = data.words[data.index]
// let s = allList.find(s => s.name === w.name)
// if (s) return s
// else return w ?? {
// trans: [],
// name: '',
// usphone: '',
// ukphone: '',
// }
return data.words[data.index] ?? {
trans: [],
name: '',
@@ -113,12 +113,7 @@ onMounted(() => {
emitter.on(EventKey.resetWord, () => {
wrong = input = ''
})
fetch('./translate/en2zh_CN.json').then(r => {
r.json().then(v => {
console.log('v', v)
allList = v
})
})
})
function next(isTyping: boolean = true) {
@@ -445,6 +440,7 @@ useOnKeyboardEventListener(onKeyDown, onKeyUp)
.phonetic, .translate {
font-size: 20rem;
margin-left: -30rem;
transition: all .3s;
}
.word-wrapper {