@coreui/vue-pro
Version:
UI Components Library for Vue.js
54 lines (50 loc) • 1.27 kB
JavaScript
var vue = require('vue');
const CCloseButton = vue.defineComponent({
name: 'CCloseButton',
props: {
/**
* 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 () => vue.h('button', {
type: 'button',
class: [
'btn',
'btn-close',
{
['btn-close-white']: props.white,
},
props.disabled,
],
'aria-label': 'Close',
disabled: props.disabled,
...(props.dark && { 'data-coreui-theme': 'dark' }),
onClick: handleClick,
});
},
});
exports.CCloseButton = CCloseButton;
//# sourceMappingURL=CCloseButton.js.map
;