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). - `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) ## 2.19.11 (2021-10-21)
### Fixes ### Fixes

View File

@ -4,6 +4,10 @@
- `n-collapsed-transition``collapsed` 属性被废弃,请使用 `show` 属性代替,关闭 [#1407](https://github.com/TuSimple/naive-ui/issues/1407) - `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) ## 2.19.11 (2021-10-21)
### Fixes ### Fixes

View File

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

View File

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