fix(popselect): default placement & padding

This commit is contained in:
07akioni 2021-09-05 13:55:14 +08:00
parent 348fb0c805
commit ec1efe318d
3 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,7 @@
- Fix `n-description`'s warning caused by `v-if` that should not appear, closes [#1083](https://github.com/TuSimple/naive-ui/issues/1083).
- Fix `n-layout`'s `sider-placement` doesn't work after build, closes [#978](https://github.com/TuSimple/naive-ui/issues/978).
- Fix `n-input-number`'s `step` calculate error when the value is decimal, closes [#1007](https://github.com/TuSimple/naive-ui/issues/1007).
- Fix `n-popselect`' s default placement and padding.
### Feats

View File

@ -15,6 +15,7 @@
- 修复 `n-description` 中因 `v-if` 导致的不该出现的警告,关闭 [#1083](https://github.com/TuSimple/naive-ui/issues/1083)
- 修复 `n-layout``sider-placement` 属性在打包之后不生效,关闭 [#978](https://github.com/TuSimple/naive-ui/issues/978)
- 修复 `n-input-number``step` 值为小数时计算错误,关闭 [#1007](https://github.com/TuSimple/naive-ui/issues/1007)
- 修复 `n-popselect` 的默认位置和 padding
### Feats

View File

@ -15,6 +15,10 @@ import { popselectInjectionKey } from './interface'
const popselectProps = {
...(useTheme.props as ThemeProps<PopselectTheme>),
...popoverBaseProps,
placement: {
...popoverBaseProps.placement,
default: 'bottom'
},
trigger: {
type: String as PropType<PopoverTrigger>,
default: 'hover'
@ -58,6 +62,9 @@ export default defineComponent({
const popoverProps: PopoverInternalProps & { ref: string } = {
theme: mergedTheme.peers.Popover,
themeOverrides: mergedTheme.peerOverrides.Popover,
builtinThemeOverrides: {
padding: '0'
},
ref: 'popoverInstRef',
internalRenderBody: (
className,