- Introduced `FormBuilderComponents.vue`, `FormBuilderCanvas.vue`, and `FormBuilderConfiguration.vue` for managing form elements. - Added `ComponentPreview.vue` for rendering previews of form components. - Implemented state management using Pinia in `stores/formBuilder.js` to handle form components and saved forms. - Created pages for form builder interface (`index.vue`) and form management (`manage.vue`). - Integrated toast notifications with `useToast.js` for user feedback. - Documented the form builder structure and features in `FORM_BUILDER_DOCUMENTATION.md` and `FORM_BUILDER_TECHNICAL_APPENDIX.md`. - Established a responsive layout and drag-and-drop functionality for a seamless user experience.
39 lines
802 B
JavaScript
39 lines
802 B
JavaScript
import { useToast as useVueToast } from 'vue-toastification';
|
|
|
|
export const useToast = () => {
|
|
const toast = useVueToast();
|
|
|
|
return {
|
|
success: (message, options = {}) => {
|
|
toast.success(message, {
|
|
timeout: 3000,
|
|
position: 'top-right',
|
|
...options
|
|
});
|
|
},
|
|
|
|
error: (message, options = {}) => {
|
|
toast.error(message, {
|
|
timeout: 5000,
|
|
position: 'top-right',
|
|
...options
|
|
});
|
|
},
|
|
|
|
warning: (message, options = {}) => {
|
|
toast.warning(message, {
|
|
timeout: 4000,
|
|
position: 'top-right',
|
|
...options
|
|
});
|
|
},
|
|
|
|
info: (message, options = {}) => {
|
|
toast.info(message, {
|
|
timeout: 3000,
|
|
position: 'top-right',
|
|
...options
|
|
});
|
|
}
|
|
};
|
|
};
|