Conversation
换成了自定义的 `s-input.vue` 组件,提供了 `update-value-on-input` 既然该都改了,那就两个都一起改掉了
Summary of ChangesHello @MoYingJi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在通过优化字体设置输入框的更新机制来提升用户界面的性能。通过引入一个自定义的输入组件,并配置其在用户输入时延迟更新绑定的值,解决了在启用自定义CSS字体时,频繁修改全局字体导致的卡顿问题,从而提供了更流畅的用户体验。 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| const handleInput = (newValue: string) => { | ||
| if (props.updateValueOnInput) { | ||
| value.value = newValue; | ||
| emit("update:value", newValue); | ||
| } else { | ||
| input.value = newValue; | ||
| } | ||
| }; |
There was a problem hiding this comment.
在 updateValueOnInput 为 true 的模式下,handleInput 函数没有更新 input 这个 ref。这可能导致 UI 输入响应延迟或闪烁,因为 <n-input> 的值绑定在 input 上,它需要等待父组件更新 prop 后通过 watch 回调才能更新,而不是在输入时立即更新。建议总是先更新 input 的值来保证 UI 实时响应。
const handleInput = (newValue: string) => {
input.value = newValue;
if (props.updateValueOnInput) {
value.value = newValue;
emit("update:value", newValue);
}
};
| }>(); | ||
|
|
||
| const input = ref(props.value); // 内部值 | ||
| const value = ref(props.value); // 外部值 |
换成了自定义的
s-input.vue组件,提供了update-value-on-input既然该都改了,那就两个都一起改掉了