fix: 修复 InputNumber 组件宽度在表单中不占满的问题

This commit is contained in:
xingyu4j
2026-05-18 16:28:19 +08:00
parent 9bb2026b4d
commit a1081bf7a6
5 changed files with 23 additions and 13 deletions

View File

@@ -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')) {