fix: 修复 InputNumber 组件宽度在表单中不占满的问题
This commit is contained in:
@@ -84,8 +84,8 @@ const NUpload = defineAsyncComponent(() =>
|
||||
import('naive-ui/es/upload').then((res) => res.NUpload),
|
||||
);
|
||||
|
||||
const withDefaultPlaceholder = <T extends Component>(
|
||||
component: T,
|
||||
const withDefaultPlaceholder = (
|
||||
component: Component,
|
||||
type: 'input' | 'select',
|
||||
componentProps: Recordable<any> = {},
|
||||
) => {
|
||||
@@ -225,7 +225,9 @@ async function initComponentAdapter() {
|
||||
inputComponent: NInput,
|
||||
}),
|
||||
Input: withDefaultPlaceholder(NInput, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(NInputNumber, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(NInputNumber, 'input', {
|
||||
style: { width: '100%' },
|
||||
}),
|
||||
RadioGroup: (props, { attrs, slots }) => {
|
||||
let defaultSlot;
|
||||
if (Reflect.has(slots, 'default')) {
|
||||
|
||||
Reference in New Issue
Block a user