加个注释以免未来读不懂
This commit is contained in:
@ -97,19 +97,30 @@
|
|||||||
countdown: 0,
|
countdown: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 显示
|
// --- 显示 ---
|
||||||
|
/** 当前正在处理的词语 */
|
||||||
let wipWord = $derived(words[status.wipWord])
|
let wipWord = $derived(words[status.wipWord])
|
||||||
|
|
||||||
|
/** 当前正在处理的词语的阶段。如果是最后一个阶段(也就是删除阶段),则取最后
|
||||||
|
* 一个元素。
|
||||||
|
*/
|
||||||
let wipStage = $derived(
|
let wipStage = $derived(
|
||||||
wipWord.stages[Math.min(status.wipStage, wipWord.stages.length - 1)],
|
wipWord.stages[Math.min(status.wipStage, wipWord.stages.length - 1)],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/** 当前的文本(未经过裁剪的,不含输入法未上屏部分) */
|
||||||
let currentText = $derived(
|
let currentText = $derived(
|
||||||
typeof wipStage == 'string' ? wipStage : wipStage.text,
|
typeof wipStage == 'string' ? wipStage : wipStage.text,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/** 如果在最后一个阶段,则根据进度去裁剪文本 */
|
||||||
let currentTextSliced = $derived(
|
let currentTextSliced = $derived(
|
||||||
status.wipStage >= wipWord.stages.length
|
status.wipStage >= wipWord.stages.length
|
||||||
? currentText.slice(0, currentText.length - status.wipEditing)
|
? currentText.slice(0, currentText.length - status.wipEditing)
|
||||||
: currentText,
|
: currentText,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/** 输入法待上屏区域 */
|
||||||
let currentEditing = $derived(
|
let currentEditing = $derived(
|
||||||
typeof wipStage == 'string' || status.wipEditing <= 0
|
typeof wipStage == 'string' || status.wipEditing <= 0
|
||||||
? ''
|
? ''
|
||||||
|
|||||||
Reference in New Issue
Block a user