-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自动调整翻译输入框中的字号 #118
Labels
Comments
这是个好主意,不过不知道是否会影响界面美观 |
Open
多行时才会调整字号,就算在当前样式下问题也不大。 我在实现时遇到两个问题:
不过当 <textarea> 达到最大高度时才触发字号的自动调整 也行,最后,字号达到一个临界值时,通过滚动条来排版更多的内容。 如果今后需要显示更多的翻译结果信息,其他内容的字号需要相应的调整。 这个 <textarea> 还有个问题是换行的问题,不应该在单词内换行。 |
可以通过传递 const H1 = styled.h1`
font-size: ${(props) => props.size}px;
color: ${(props) => props.color};
transition: all 0.3s ease;
`; @Component
export default class Test extends Vue {
size = 12;
color = 'red';
created() {
setTimeout(() => {
this.size = 16;
this.color = 'green';
}, 500);
}
render() {
const { size, color } = this;
return (
<H1 size={size} color={color}>
Title
</H1>
);
}
}
这个应该可以用
这个需要把
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
类似谷歌翻译的 webapp,字数或者行数过多时调整字号
The text was updated successfully, but these errors were encountered: