Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 tailwindcss 后导致 Input 组件的clearIcon向下偏移问题 #7982

Open
1 task done
LuckyZiLong opened this issue Dec 20, 2024 · 0 comments
Open
1 task done

Comments

@LuckyZiLong
Copy link

LuckyZiLong commented Dec 20, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

Windows 24h2 26100.2605, Chrome 131.0.6778.140, Vue 3.5.13

Reproduction link

https://github.com/luzilong2005/antd-vue-input-bug.git

Steps to reproduce

安装 tailwindcss postcss autoprefixer模块并初始化后

在项目的src文件夹下的App.vue文件里面添加如下代码:

<template>
  <div>
    <Form style="width: 340px;">
      <FormItem>
        <Input placeholder="输入" allow-clear>
          <template #prefix>
            Hello
          </template>
        </Input>
      </FormItem>
    </Form>
  </div>
</template>

<script setup lang="ts">
import { Form, FormItem, Input } from "ant-design-vue";
</script>

如果使用了自定义的clearIcon插槽,结果显示正确

<template>
  <div>
    <Form style="width: 340px">
      <FormItem>
        <Input placeholder="输入" allow-clear>
          <template #prefix> Hello </template>
          <template #clearIcon> Hi </template>
        </Input>
      </FormItem>
    </Form>
  </div>
</template>

<script setup lang="ts">
import { Form, FormItem, Input } from "ant-design-vue";
</script>

What is expected?

Input 的 clearIcon应该保持在水平线上

结果

What is actually happening?

Input 的 clearIcon 向下偏移了一段距离
Bug


该项目使用 pnpm create vite 的 Customize with create-vue。根据antd文档提示使用了局部组件,并在main.ts文件里正确引入了 import "ant-design-vue/dist/reset.css"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant