fix(p): warns when depth is number

This commit is contained in:
07akioni 2021-09-09 00:52:23 +08:00
parent a61efd370a
commit b731e52dfc
9 changed files with 22 additions and 48 deletions

View File

@ -9,6 +9,10 @@
- `n-date-picker` add `input-readonly` prop, closes [#1120](https://github.com/TuSimple/naive-ui/issues/1120).
- `n-time-picker` add `input-readonly` prop, closes [#1120](https://github.com/TuSimple/naive-ui/issues/1120).
### Fixes
- Fix `n-p` warns when `depth` is number.
## 2.18.1 (2021-09-08)
### Feats

View File

@ -9,6 +9,10 @@
- `n-date-picker` 新增 `input-readonly` 属性,关闭 [#1120](https://github.com/TuSimple/naive-ui/issues/1120)
- `n-time-picker` 新增 `input-readonly` 属性,关闭 [#1120](https://github.com/TuSimple/naive-ui/issues/1120)
### Fixes
- 修复 `n-p` `depth` 传入 number 报错
## 2.18.1 (2021-09-08)
### Feats

View File

@ -13,7 +13,7 @@ text
router-link
```
## Props
## API
### Text Props
@ -54,8 +54,6 @@ router-link
| ---------- | --------- | ------- | ----------- |
| align-text | `boolean` | `false` | Text align. |
## Slots
### All Typography Components
| Name | Parameters | Description |

View File

@ -13,7 +13,7 @@ text
router-link
```
## Props
## API
### Text Props
@ -54,9 +54,7 @@ router-link
| ---------- | --------- | ------- | -------- |
| align-text | `boolean` | `false` | 文本对齐 |
## Slots
### All Typography Components
### All Typography Components Slots
| 名称 | 参数 | 说明 |
| ------- | ---- | ---------- |

View File

@ -8,10 +8,7 @@ import type { ExtractPublicPropTypes } from '../../_utils'
const blockquoteProps = {
...(useTheme.props as ThemeProps<TypographyTheme>),
alignText: {
type: Boolean,
default: false
}
alignText: Boolean
} as const
export type BlockquoteProps = ExtractPublicPropTypes<typeof blockquoteProps>

View File

@ -8,10 +8,7 @@ import style from './styles/list.cssr'
const olProps = {
...(useTheme.props as ThemeProps<TypographyTheme>),
alignText: {
type: Boolean,
default: false
}
alignText: Boolean
}
export type OlProps = ExtractPublicPropTypes<typeof olProps>

View File

@ -8,7 +8,7 @@ import type { ExtractPublicPropTypes } from '../../_utils'
const pProps = {
...(useTheme.props as ThemeProps<TypographyTheme>),
depth: String as PropType<1 | 2 | 3 | '1' | '2' | '3' | undefined>
depth: [String, Number] as PropType<1 | 2 | 3 | '1' | '2' | '3'>
}
export type PProps = ExtractPublicPropTypes<typeof pProps>

View File

@ -17,38 +17,17 @@ import style from './styles/text.cssr'
const textProps = {
...(useTheme.props as ThemeProps<TypographyTheme>),
code: {
type: Boolean,
default: false
},
code: Boolean,
type: {
type: String,
default: 'default'
},
delete: {
type: Boolean,
default: false
},
strong: {
type: Boolean,
default: false
},
italic: {
type: Boolean,
default: false
},
underline: {
type: Boolean,
default: false
},
depth: {
type: [String, Number] as PropType<1 | 2 | 3 | '1' | '2' | '3' | undefined>,
default: undefined
},
tag: {
type: String,
default: undefined
},
delete: Boolean,
strong: Boolean,
italic: Boolean,
underline: Boolean,
depth: [String, Number] as PropType<1 | 2 | 3 | '1' | '2' | '3'>,
tag: String,
// deprecated
as: {
type: String,

View File

@ -8,10 +8,7 @@ import type { ExtractPublicPropTypes } from '../../_utils'
const ulProps = {
...(useTheme.props as ThemeProps<TypographyTheme>),
alignText: {
type: Boolean,
default: false
}
alignText: Boolean
} as const
export type UlProps = ExtractPublicPropTypes<typeof ulProps>