-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(code): add word-wrap
prop
#2129
Conversation
Signed-off-by: Sepush <[email protected]>
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tusimple/naive-ui/3TLaHUcQ4bW2pZCtFFRbq6gvKvyk |
<p class="n-p" data-v-79af885b="" style="--n-bezier:cubic-bezier(0.4, 0, 0.2, 1); --n-font-size:14px; --n-line-height:1.6; --n-text-color:rgb(51, 54, 57); font-size: 16px; margin-top: 0px; margin-bottom: 0px;">还是得再学习一个</p> | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这代码感觉有点迷惑性啊,换一个更直观的?某种编程语言的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好
@@ -0,0 +1,23 @@ | |||
<markdown> | |||
# 软换行 | |||
</markdown> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加个描述
“code 可以在溢出时自动换行“
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/code/src/styles/index.cssr.ts
Outdated
@@ -23,6 +23,7 @@ export default c([ | |||
c('pre', ` | |||
margin: 0; | |||
font-family: inherit; | |||
white-space: pre-wrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个需要加一个新的属性,叫 word-wrap
,默认关闭。
不换行才是默认的需求。
换行需要加属性。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Sepush <[email protected]>
@@ -23,7 +24,7 @@ export default c([ | |||
c('pre', ` | |||
margin: 0; | |||
font-family: inherit; | |||
white-space: pre-wrap; | |||
white-space: var(--n-word-wrap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个别通过变量实现,直接加个类就行,这个变量对用户没有任何调整的价值
Signed-off-by: Sepush [email protected]
add
word-wrap
propclose #2111