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

feat(dynamic-input): customizable add/delete/move buttons #3981

Closed
OrbisK opened this issue Nov 2, 2022 · 4 comments · Fixed by #3999
Closed

feat(dynamic-input): customizable add/delete/move buttons #3981

OrbisK opened this issue Nov 2, 2022 · 4 comments · Fixed by #3999
Assignees
Labels
feature request New feature or request

Comments

@OrbisK
Copy link
Collaborator

OrbisK commented Nov 2, 2022

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

The default buttons are currently not customizable.

Expected API (期望的 API)

<n-dynamic-input>
  <template #action="{create, delete, moveUp, moveDown, }">
    <n-button-group>
      <n-button @click="create.handler" :disabled="create.isDisabled"></n-button>
      <n-button @click="delete.handler" :disabled="delete.isDisabled"></n-button>
      <n-button @click="moveUp.handler" :disabled="moveUp.isDisabled">🆙</n-button>
      <n-button @click="moveDown.handler" :disabled="moveDown.isDisabled">👇🏽</n-button>
    </n-button-group>
  </template>
</n-dynamic-input>

I think my slotProps are not perfect. But they doing there job here 😄.

An additional render function would be nice.

@XieZongChen
Copy link
Collaborator

XieZongChen commented Nov 3, 2022

I think it may not be possible to provide #action, but I can add slots for custom buttons
I need to think about how to provide APIs

@XieZongChen XieZongChen self-assigned this Nov 3, 2022
@XieZongChen
Copy link
Collaborator

I think we usually just want to custom the button icon, right?

@OrbisK
Copy link
Collaborator Author

OrbisK commented Nov 3, 2022

I think we usually just want to custom the button icon, right?

Usally icons.

Maybe we can provide a prop like buttonProps

@XieZongChen
Copy link
Collaborator

No problem. I'll develop this plan.

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

Successfully merging a pull request may close this issue.

2 participants