antdesign表格中加入下拉框后,鼠标移入下拉框内容后当前行白屏bug

1. bug出现原因解释

  1. 这块是样式没有覆盖全面的问题,一般出现在没有自定义样式的项目中

2. 解决方案

  1. 第一种就是自定义主题方案,当然 你看到这篇文章的时候你也不会选这个处理方案了- - 因为你项目是主题覆盖模式
  2. 第二种方案,在你覆盖全局table样式的地方加入以下代码即可(umi项目一般位置就在 src/global.css 这个位置)。
.ant-table .ant-table-cell-row-hover {
  background-color: transparent!important;
}

以上css代码,是设置背景色透明度,你后面覆盖的选择颜色看你自己加。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 Ant Design Vue 的可编辑表格使用下框,可以使用 Select 组件。首先,你需要在表格的列定义配置一个编辑器,通过 render 函数返回一个 Select 组件。 以下是一个简单的示例代码: ```vue <template> <a-table :data-source="dataSource" :columns="columns"> <!-- 其他列定义 --> <template #action="{ text, record }"> <a @click="startEditing(record.key)">编辑</a> </template> </a-table> </template> <script> import { ref } from 'vue'; import { Table, Select, Button, Popconfirm } from 'ant-design-vue'; export default { components: { Table, Select, Button, Popconfirm, }, setup() { const dataSource = ref([ { key: 1, name: 'John', age: 32, city: 'New York' }, { key: 2, name: 'Alice', age: 28, city: 'London' }, // 其他数据 ]); const columns = [ { title: 'Name', dataIndex: 'name' }, { title: 'Age', dataIndex: 'age' }, { title: 'City', dataIndex: 'city', customRender: ({ text, record, index }) => { const editing = ref(false); const selectedCity = ref(record.city); const startEditing = (key) => { editing.value = true; }; const handleSave = () => { // 处理保存逻辑,比如更新数据源、发送请求等 editing.value = false; }; return editing.value ? ( <Select v-model={[selectedCity.value, 'value']}> <a-select-option value="New York">New York</a-select-option> <a-select-option value="London">London</a-select-option> <a-select-option value="Paris">Paris</a-select-option> </Select> ) : ( <span>{text}</span> ); }, }, { title: 'Action', key: 'action', customRender: ({ record }) => ( <span> <a-button type="link" onClick={() => startEditing(record.key)}> Edit </a-button> <a-popconfirm title="Sure to delete?" onConfirm={() => handleDelete(record.key)} > <a-button type="link">Delete</a-button> </a-popconfirm> </span> ), }, ]; return { dataSource, columns, }; }, }; </script> ``` 在上面的示例,`columns` 数组定义了表格的列,其 City 列使用了自定义渲染函数 `customRender` 来渲染下框编辑器。当点击编辑按钮时,下框会显示为可编辑状态,用户可以选择不同的选项。点击保存按钮后,可以处理保存逻辑,比如更新数据源、发送请求等。 这只是一个简单的示例,你可以根据自己的需求进修改和扩展。希望对你有帮助!如有任何疑问,请随时询问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值