fix: all components' exported props type's prop is readonly

This commit is contained in:
07akioni 2022-07-26 01:16:43 +08:00
parent cc0cdbecc1
commit 6b8e994526
3 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,7 @@
- Fix `n-tree` may throw error on node selection `expanded-keys`, closes [#3319](https://github.com/TuSimple/naive-ui/issues/3319).
- Fix `n-avatar` shows placeholder after load fails, closes [#3315](https://github.com/TuSimple/naive-ui/issues/3315).
- Fix `n-input-number` register `mouseup` event multiple times when hold on button.
- Fix all components' exported props type's prop is `readonly`.
### Feats

View File

@ -19,6 +19,7 @@
- 修复 `n-tree` 在选中节点时设定 `expanded-keys` 时可能会抛出异常,关闭 [#3319](https://github.com/TuSimple/naive-ui/issues/3319)
- 修复 `n-avatar` 加载失败时依然显示 placeholder关闭 [#3315](https://github.com/TuSimple/naive-ui/issues/3315)
- 修复 `n-input-number` 按住按钮时重复注册 `mouseup` 事件
- 修复所有组件导出的 props 类型属性都是 `readonly`
### Feats

View File

@ -3,8 +3,12 @@ import { useTheme } from '../../_mixins'
type themePropKeys = keyof typeof useTheme.props
type RemoveReadonly<T> = {
-readonly [key in keyof T]: T[key]
}
export type ExtractPublicPropTypes<T> = Omit<
Partial<ExtractPropTypes<T>>,
Partial<RemoveReadonly<ExtractPropTypes<T>>>,
| Exclude<themePropKeys, 'themeOverrides'>
| Extract<keyof T, `internal${string}`>
>