useDialog.js 564B

12345678910111213141516171819202122232425262728293031
  1. import { useDialog as usePrimeDialog } from 'primevue/usedialog'
  2. import CustomerCreate from '../Components/CustomerCreate.vue'
  3. export function useDialog() {
  4. const dialog = usePrimeDialog()
  5. const dialogStyle = {
  6. style: {
  7. width: '50vw',
  8. },
  9. breakpoints: {
  10. '960px': '75vw',
  11. '640px': '90vw',
  12. },
  13. modal: true,
  14. }
  15. const onShowCustomerCreate = () => {
  16. dialog.open(CustomerCreate, {
  17. props: {
  18. header: 'Tambah Pelanggan',
  19. ...dialogStyle,
  20. },
  21. })
  22. }
  23. return {
  24. onShowCustomerCreate,
  25. }
  26. }