如何 naive UI n-data-table 改变行移动光标背景色
默认是light 灰,想换个显眼包色,折腾半天,可以了。
无废话上代码:
<template><n-data-tablesize="small":columns="columns":data="sortedDataList":bordered="true":row-key="(row) => row.id":scroll-x="1150":row-class-name="rowClassName"@update:sorter="handleSorterChange"/>
</template><script setup>const rowClassName = () => {return "custom-row";};
</script><style scoped>:deep(.custom-row:hover td) {background-color: #d5f1ef !important;box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);cursor: pointer;transition: all 0.2s ease-in-out;
}
</style>
bye!