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

使用prefix-cls设置组件类名前缀后,a-input插入前缀图标无法显示 #3263

Open
1 task
Beluga-9527 opened this issue Aug 13, 2024 · 0 comments
Open
1 task

Comments

@Beluga-9527
Copy link

基本信息

  • 依赖包名 及 版本: @arco-design/[email protected]
  • 框架版本: 2.56.0
  • 浏览器版本: chrome127.0.6533.100

额外补充

自定义类名前缀后a-input也有其它样式问题,例如allow-clear属性清空图标没有垂直居中,图标也没有了hover效果等

复现步骤

  1. App.vue设置类名前缀
<a-config-provider prefix-cls="hly">
      <router-view></router-view>
 </a-config-provider>
  1. 在less文件中分别设置了@Prefix: 'hly'; 和 @arco-vars-prefix: 'hly';
@prefix: 'hly';
@arco-vars-prefix: 'hly';

/* 设置主色调 */
//@arcoblue-6: #ff1631;
@size-8: 34px;
@size-9: 42px;

/* 引入arco less库 */
@import "@arco-design/web-vue/es/index.less";
  1. a-input设置前缀<template #prefix>
<a-form-item field="account" feedback hide-asterisk>
  <a-input v-model="formData.account" placeholder="请输入账号" allow-clear>
    <template #prefix>
      <icon-user />
    </template>
  </a-input>
</a-form-item>
import { IconUser } from "@arco-design/web-vue/es/icon"
  1. 前缀图标无法显示,需要手动设置宽度才能显示.hly-icon { width: 14px; }
.hly-icon {
  width: 14px;
}
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