From a926d7bcfb1ce62a362f13f4a7aeb6897f0e2392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Thu, 21 Nov 2024 12:20:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20sweetalert2=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=B9=B6=E6=9B=B4=E6=96=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=B8=BA=20SweetAlert2=20=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 17 +++++++++++++++++ src/tutorial-form/index.vue | 8 +++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index cafd883..01c3264 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "autoprefixer": "latest", "i18next": "^23.16.6", "postcss": "latest", + "sweetalert2": "^11.14.5", "tailwindcss": "latest", "vue": "^3.5.13", "zod-i18n-map": "^2.27.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 471a4fb..3cdcd45 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: postcss: specifier: latest version: 8.4.49 + sweetalert2: + specifier: ^11.14.5 + version: 11.14.5 tailwindcss: specifier: latest version: 3.4.15 @@ -368,46 +371,55 @@ packages: resolution: {integrity: sha512-6npqOKEPRZkLrMcvyC/32OzJ2srdPzCylJjiTJT2c0bwwSGm7nz2F9mNQ1WrAqCBZROcQn91Fno+khFhVijmFA==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.27.2': resolution: {integrity: sha512-V9Xg6eXtgBtHq2jnuQwM/jr2mwe2EycnopO8cbOvpzFuySCGtKlPCI3Hj9xup/pJK5Q0388qfZZy2DqV2J8ftw==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.27.2': resolution: {integrity: sha512-uCFX9gtZJoQl2xDTpRdseYuNqyKkuMDtH6zSrBTA28yTfKyjN9hQ2B04N5ynR8ILCoSDOrG/Eg+J2TtJ1e/CSA==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.27.2': resolution: {integrity: sha512-/PU9P+7Rkz8JFYDHIi+xzHabOu9qEWR07L5nWLIUsvserrxegZExKCi2jhMZRd0ATdboKylu/K5yAXbp7fYFvA==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-powerpc64le-gnu@4.27.2': resolution: {integrity: sha512-eCHmol/dT5odMYi/N0R0HC8V8QE40rEpkyje/ZAXJYNNoSfrObOvG/Mn+s1F/FJyB7co7UQZZf6FuWnN6a7f4g==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.27.2': resolution: {integrity: sha512-DEP3Njr9/ADDln3kNi76PXonLMSSMiCir0VHXxmGSHxCxDfQ70oWjHcJGfiBugzaqmYdTC7Y+8Int6qbnxPBIQ==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.27.2': resolution: {integrity: sha512-NHGo5i6IE/PtEPh5m0yw5OmPMpesFnzMIS/lzvN5vknnC1sXM5Z/id5VgcNPgpD+wHmIcuYYgW+Q53v+9s96lQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.27.2': resolution: {integrity: sha512-PaW2DY5Tan+IFvNJGHDmUrORadbe/Ceh8tQxi8cmdQVCCYsLoQo2cuaSj+AU+YRX8M4ivS2vJ9UGaxfuNN7gmg==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.27.2': resolution: {integrity: sha512-dOlWEMg2gI91Qx5I/HYqOD6iqlJspxLcS4Zlg3vjk1srE67z5T2Uz91yg/qA8sY0XcwQrFzWWiZhMNERylLrpQ==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.27.2': resolution: {integrity: sha512-euMIv/4x5Y2/ImlbGl88mwKNXDsvzbWUlT7DFky76z2keajCtcbAsN9LUdmk31hAoVmJJYSThgdA0EsPeTr1+w==} @@ -903,6 +915,9 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + sweetalert2@11.14.5: + resolution: {integrity: sha512-8MWk5uc/r6bWhiJWkUXyEuApfXAhSCZT8FFX7pZXL7YwaPxq+9Ynhi2dUzWkOFn9jvLjKj22CXuccZ+IHcnjvQ==} + tailwindcss@3.4.15: resolution: {integrity: sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==} engines: {node: '>=14.0.0'} @@ -1787,6 +1802,8 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + sweetalert2@11.14.5: {} + tailwindcss@3.4.15: dependencies: '@alloc/quick-lru': 5.2.0 diff --git a/src/tutorial-form/index.vue b/src/tutorial-form/index.vue index 98226f7..8faf888 100644 --- a/src/tutorial-form/index.vue +++ b/src/tutorial-form/index.vue @@ -2,11 +2,17 @@ import { FormKitSchemaDefinition, getNode, type FormKitNode } from '@formkit/core'; import { onMounted } from 'vue'; import Guests from './guests.vue'; +import Swal from 'sweetalert2' async function submit(...args: any[]) { console.debug('submit', `args :>> `, args); await new Promise(r => setTimeout(r, 1000)) - alert('Submitted! 🎉') + Swal.fire({ + title: 'Submitted! 🎉', + icon: 'success', + showConfirmButton: false, + timer: 1500 + }) } const castNumber = (node: FormKitNode) => {