Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sweet alert in default/components/layout/_js implementation #1

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

Brunin12
Copy link
Owner

@Brunin12 Brunin12 commented Dec 3, 2023

Sweet Alert na implementação de default/components/layout/_js

Neste exemplo, vamos mostrar como implementar o Sweet Alert em um arquivo JavaScript localizado na pasta default/components/layout.

Instalação do Sweet Alert

1. Primeiro, você precisa fazer o download do Sweet Alert. Você pode encontrar o arquivo de script no site oficial do Sweet Alert.

2. Após o download, coloque o arquivo do Sweet Alert na pasta default/components/layout.

Implementação

Agora, vamos demonstrar como utilizar o Sweet Alert em um arquivo JavaScript chamado main.js na pasta default/components/layout/_js.

1. Abra o arquivo main.js e importe o arquivo do Sweet Alert da seguinte maneira:

import Swal from '../sweetalert2.min.js';
Agora, você pode utilizar as funções do Sweet Alert em seu código JavaScript. Aqui está um exemplo de como mostrar um alerta simples:
javascript
Copiar
Swal.fire({
  title: 'Hello!',
  text: 'This is a Sweet Alert!',
  icon: 'success',
});

Você pode personalizar o alerta de acordo com suas necessidades. Consulte a documentação oficial do Sweet Alert para obter mais informações sobre as opções disponíveis.

Conclusão

A implementação do Sweet Alert em um arquivo JavaScript na pasta default/components/layout pode ser feita seguindo os passos mencionados acima. Certifique-se de importar corretamente o arquivo do Sweet Alert e utilize as funções disponíveis para criar alertas personalizados em seu projeto.

Copy link

vercel bot commented Dec 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
code-admin ❌ Failed (Inspect) Dec 3, 2023 10:04pm

Copy link

github-actions bot commented Dec 3, 2023

Thank you for your pull request. However, you have submitted your PR on a read-only split of codeigniter4/CodeIgniter4. This repository, unfortunately, does not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4 repository.

Thank you.

@github-actions github-actions bot closed this Dec 3, 2023
@Brunin12 Brunin12 reopened this Dec 3, 2023
@Brunin12 Brunin12 merged commit 32c01ca into main Dec 3, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant