Zum Inhalt springen

Anfang

GitHub

Install

Install

Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie den Capgo-Fähigkeiten Ihrer AI-Werkzeugleiste hinzu, indem Sie den folgenden Befehl ausführen:

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

Dann verwenden Sie den folgenden Vorschlag:

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

Wenn Sie die manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und folgen Sie den unten angegebenen Plattform-spezifischen Anweisungen:

Terminalfenster
npm install @capgo/capacitor-pretty-toast
npx cap sync

Importieren

Importieren
import { toast } from '@capgo/capacitor-pretty-toast';
toast.success('Saved', {
message: 'Your changes are ready.',
});
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);
await toast.promise(uploadFile(), {
loading: {
title: 'Uploading',
message: 'Keep the app open while the file is sent.',
},
success: 'Uploaded',
error: 'Upload failed',
});

Benutze icon für einen Symbolnamen oder rohe SVG-Markup:

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

Benutze iconSource für URI-artige Bilder. Es unterstützt https://, http://, file://, data:, blob:absolute Dateipfade oder { uri }.

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

iconSource hat Vorrang vor icon.

Wenn Sie Getting Started verwenden Getting Started für die native Plugin-Arbeit zu planen, mit ihr verbunden Capgo Plugin-Verzeichnis für den Produktworkflow in Capgo Plugin-Verzeichnis Capacitor Plugins von Capgo für die Implementierungsdetails in Capacitor Plugins von Capgo Plugins hinzufügen oder aktualisieren für die Implementierungsdetails in Plugins hinzufügen oder aktualisieren Alternativen zu Ionic Enterprise Plugins für den Produktworkflow in Alternativen zu Ionic Enterprise Plugins, und Capgo Native Builds für den Produktworkflow in Capgo Native Builds