Pindah ke konten

Mulai Menggunakan

GitHub

Kamu bisa menggunakan Setup Bantu AI kami untuk menginstal plugin. Tambahkan Capgo kemampuan ke alat AI kamu menggunakan perintah berikut:

Jendela Terminal
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Kemudian gunakan prompt berikut:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pretty-toast` plugin in my project.

Jika kamu lebih suka Setup Manual, instal plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah ini:

Jendela Terminal
npm install @capgo/capacitor-pretty-toast
npx cap sync
import { toast } from '@capgo/capacitor-pretty-toast';
toast.success('Saved', {
message: 'Your changes are ready.',
});

Toast Pemberitahuan Mengupdate

Munculkan Toast yang Berubah
const id = toast.loading('Uploading', {
message: 'Waiting for the server response.',
});
setTimeout(() => {
toast.update(id, {
title: 'Upload complete',
message: 'The file was stored successfully.',
icon: 'checkmark.circle.fill',
autoDismiss: true,
});
}, 1500);

Bab berjudul “Munculkan Toast yang Berubah”

Section titled “Track A Promise”
await toast.promise(uploadFile(), {
loading: {
title: 'Uploading',
message: 'Keep the app open while the file is sent.',
},
success: 'Uploaded',
error: 'Upload failed',
});

Bab berjudul “Ikuti Sebuah Promes”

Section titled “Icons And Images”

Use icon Menggunakan untuk nama simbol atau markup SVG mentah:

toast.info('New message', {
icon: 'message.fill',
message: 'Open the inbox to reply.',
});

Menggunakan iconSource Menggunakan untuk gambar seperti URI. Ia mendukung https://, http://, file://, data:, blob:Peta file absolut, { uri }.

toast.show({
title: 'Profile updated',
message: 'Your avatar changed.',
iconSource: 'https://example.com/avatar.png',
});

iconSource berlaku sebelum icon.

Jika Anda menggunakan Mulai Menggunakan untuk merencanakan pekerjaan plugin native, hubungkannya dengan Capgo Direktori Plugin untuk alur kerja produk di Capgo Direktori Plugin, Capacitor Plugin oleh Capgo untuk detail implementasi di Capacitor Plugin oleh Capgo, Menambahkan atau Mengupdate Plugin untuk detail implementasi di Menambahkan atau Mengupdate Plugin, Alternatif Plugin Enterprise Ionic untuk alur kerja produk di Alternatif Plugin Enterprise Ionic, dan Capgo Bangun Natively untuk alur kerja produk di Capgo Bangun Natively.