UNPKG

@coreui/vue

Version:

UI Components Library for Vue.js

44 lines (40 loc) 1.25 kB
'use strict'; var vue = require('vue'); var CCloseButton = require('../close-button/CCloseButton.js'); const CToastClose = vue.defineComponent({ name: 'CToastClose', props: { /** * Component used for the root node. Either a string to use a HTML element or a component. */ as: [String, Object], ...CCloseButton.CCloseButton.props, }, emits: [ /** * Event called before the dissmiss animation has started. */ 'close', ], setup(props, { slots, emit }) { const updateVisible = vue.inject('updateVisible'); const handleClose = () => { emit('close'); updateVisible(false); }; return () => props.as ? vue.h(typeof props.as === 'string' ? vue.resolveComponent(props.as) : props.as, { onClick: () => { handleClose(); }, }, () => slots.default && slots.default()) : vue.h(CCloseButton.CCloseButton, { ...props, onClick: () => { handleClose(); }, }); }, }); exports.CToastClose = CToastClose; //# sourceMappingURL=CToastClose.js.map