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

@@ -89,8 +89,8 @@ const TreeSelect = defineAsyncComponent(
);
const Upload = defineAsyncComponent(() => import('tdesign-vue-next/es/upload'));
const withDefaultPlaceholder = <T extends Component>(
component: T,
const withDefaultPlaceholder = (
component: Component,
type: 'input' | 'select',
componentProps: Recordable<any> = {},
) => {
@@ -239,7 +239,9 @@ async function initComponentAdapter() {
modelValueProp: 'value',
}),
Input: withDefaultPlaceholder(Input, 'input'),
InputNumber: withDefaultPlaceholder(InputNumber, 'input'),
InputNumber: withDefaultPlaceholder(InputNumber, 'input', {
style: { width: '100%' },
}),
// InputPassword: withDefaultPlaceholder(InputPassword, 'input'),
// Mentions: withDefaultPlaceholder(Mentions, 'input'),
// 自定义主要按钮