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

DataTable: selectionProps #3613

Closed
OrbisK opened this issue Aug 28, 2022 · 1 comment
Closed

DataTable: selectionProps #3613

OrbisK opened this issue Aug 28, 2022 · 1 comment
Labels
feature request New feature or request

Comments

@OrbisK
Copy link
Collaborator

OrbisK commented Aug 28, 2022

This function solves the problem (这个功能解决的问题)

Selection is not customizable.

Expected API (期望的 API)

<template>
    <n-data-table :selection-props="sProps"/>
</template>

<script setup>
const sProps = {
    size: 'small'
}
</script>

or

<template>
    <n-data-table :selection-props="sProps"/>
</template>

<script setup>
const sProps = ({ rowData, isHeader})=>{
    if(isHeader) return ({size: 'large'})

    switch(rowData.status){
        case 'error':
            return {'theme-overrides': {colorChecked: 'red'}, size: 'small'}
        case 'warning':
            return {'theme-overrides': {colorChecked: 'yellow'}, size: 'small'}
    }

}
</script>
@github-actions github-actions bot added the feature request New feature or request label Aug 28, 2022
@OrbisK
Copy link
Collaborator Author

OrbisK commented Sep 12, 2022

fc3ee84 is nice, but actually not the feature I am requesting.
I am talking about the selection checkbox. So someone can customize the appearance of the checkbox depending on row.data.

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

No branches or pull requests

1 participant