tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
15.87k stars 1.66k forks source link

Card: customizable close button #3597

Open OrbisK opened 2 years ago

OrbisK commented 2 years ago

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

currently it is not possible to use an other icon or another kind of button as close button. (without overriding header-extra)

Expected API (期望的 API)

<n-card
    :close-button-props="{round: true}",
    :render-close-icon="()=>h(NIcon, {}, ()=>h(MyFunnyIcon))">
...
</n-card>

or

<n-card
    :close-button-props="{round: true}",
>
    <tempalte #closeIcon>
        <n-icon><MyFunnyIcon></n-icon>
    </template>
</n-card>
OrbisK commented 2 years ago

same is for dialog

OrbisK commented 2 years ago

@Sepush #3598 does not fully adress the request. Its still not possible to change close button props like round 👀

Sepush commented 2 years ago

@Sepush #3598 does not fully adress the request. Its still not possible to change close button props like round 👀

I added a close-style prop for it