fix(log): font-size prop not working, closes #1416

This commit is contained in:
07akioni 2021-10-24 00:36:51 +08:00
parent 6be0929805
commit 0cbb1730cb
4 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,10 @@
- `n-collapsed-transition`'s `collapsed` prop is deprecated, please use `show` instead, closes [#1407](https://github.com/TuSimple/naive-ui/issues/1407).
### Fixes
- Fix `n-log` `font-size` prop not working, closes [#1416](https://github.com/TuSimple/naive-ui/issues/1416).
## 2.19.11 (2021-10-21)
### Fixes

View File

@ -4,6 +4,10 @@
- `n-collapsed-transition``collapsed` 属性被废弃,请使用 `show` 属性代替,关闭 [#1407](https://github.com/TuSimple/naive-ui/issues/1407)
### Fixes
- 修复 `n-log` `font-size` 属性不生效,关闭 [#1416](https://github.com/TuSimple/naive-ui/issues/1416)
## 2.19.11 (2021-10-21)
### Fixes

View File

@ -31,6 +31,7 @@ const codeProps = {
uri: Boolean,
inline: Boolean,
// In n-log, we only need to mount code's style for highlight
internalFontSize: Number,
internalNoHighlight: Boolean
}
@ -117,8 +118,9 @@ export default defineComponent({
'hue-6-2': $9
}
} = themeRef.value
const { internalFontSize } = props
return {
'--font-size': fontSize,
'--font-size': internalFontSize ? `${internalFontSize}px` : fontSize,
'--font-family': fontFamilyMono,
'--font-weight-strong': fontWeightStrong,
'--bezier': cubicBezierEaseInOut,

View File

@ -271,6 +271,7 @@ export default defineComponent({
default: () => (
<NCode
internalNoHighlight
internalFontSize={this.fontSize}
theme={mergedTheme.peers.Code}
themeOverrides={mergedTheme.peerOverrides.Code}
>