LoginSignup
0
0

More than 1 year has passed since last update.

Laravel 10 で sweetalert2の使用方法

Posted at

GitHub で詳細をご覧ください: SweetAlert2
https://github.com/sweetalert2/sweetalert2

1. NPM の使用

ターミナルを開き、Laravel プロジェクトのルート ディレクトリに移動します。
次のコマンドを実行して、SweetAlert2 をインストールします。

npm install sweetalert2
app.js
// ES6 Modules or TypeScript
import Swal from 'sweetalert2'
window.Swal = Swal;
app.scss
@import '~sweetalert2/src/sweetalert2.scss';

アセットをコンパイル

npm run dev

2. CDN ファイルの使用

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

または

<link href='https://cdn.jsdelivr.net/npm/sweetalert2@10.10.1/dist/sweetalert2.min.css'>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.all.min.js"></script>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0