Skip to content

Commit

Permalink
fix: 由于更新ant-vue 新版本到 4.0.2以上 tsx 渲染 FormItem 插入style 导致的出错 改换class (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceJiang authored Sep 12, 2023
1 parent 3ed49c3 commit f4149c2
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/views/demo/form/CustomerForm.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<PageWrapper title="自定义组件示例">
<CollapseContainer title="自定义表单">
<BasicForm @register="register" @submit="handleSubmit">
<BasicForm class="local_form" @register="register" @submit="handleSubmit">
<template #f3="{ model, field, disabled }">
<a-input v-model:value="model[field]" :disabled="disabled" placeholder="自定义slot" />
</template>
Expand Down Expand Up @@ -144,11 +144,7 @@
<Select.Option value="测试类型">测试类型</Select.Option>
<Select.Option value="测试名称">测试名称</Select.Option>
</Select>
<FormItem
name="typeValue2"
style="width: calc(100% - 120px); margin-left: -1px; border-right: 0; margin-bottom: 0;"
rules={[{ required: true }]}
>
<FormItem name="typeValue2" class="local_typeValue" rules={[{ required: true }]}>
<Input placeholder="请输入" v-model:value={model['typeValue2']} disabled={disabled} />
</FormItem>
</Input.Group>
Expand Down Expand Up @@ -237,3 +233,15 @@
},
});
</script>
<style lang="less" scoped>
:deep(.local_form) .local_typeValue {
width: calc(100% - 120px);
margin-bottom: 0;
margin-left: -1px;
border-right: 0;
.ant-input {
border-radius: 0 6px 6px 0;
}
}
</style>

0 comments on commit f4149c2

Please sign in to comment.