UNPKG

@coreui/vue

Version:

UI Components Library for Vue.js

61 lines (58 loc) 1.47 kB
import { defineComponent, h } from 'vue'; const CCloseButton = defineComponent({ name: 'CCloseButton', props: { /** * Sets the `aria-label` attribute of the close button. * * @since 5.10.0 */ ariaLabel: { type: String, default: 'Close', }, /** * Invert the default color. */ dark: Boolean, /** * Toggle the disabled state for the component. */ disabled: Boolean, /** * Change the default color to white. */ white: Boolean, }, emits: [ /** * Event called when the user clicks on the component. */ 'click', ], setup(props, { emit }) { const handleClick = () => { if (props.disabled) { return; } emit('click'); }; return () => h('button', { type: 'button', class: [ 'btn', 'btn-close', { ['btn-close-white']: props.white, }, props.disabled, ], 'aria-label': props.ariaLabel, disabled: props.disabled, ...(props.dark && { 'data-coreui-theme': 'dark' }), onClick: handleClick, }); }, }); export { CCloseButton }; //# sourceMappingURL=CCloseButton.js.map