내용으로 건너뛰기

Getting Started

설치

설치
터미널 창
npm install @capgo/capacitor-pretty-toast
npx cap sync

Import

Import
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',
});

아이콘 및 이미지

아이콘 및 이미지 섹션

사용 icon symbol 이름 또는 raw SVG 마크업:

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

사용 iconSource URI-like 이미지에 대해. 그것은 https://, http://, file://, data:, blob:, 절대 파일 경로, 또는 { uri }.

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

iconSource 우선권을 가진다. icon.

Getting Started에서 계속하기

Getting Started에서 계속하기

native 플러그인 작업을 계획하고 있다면 Getting Started Getting Started Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리에서 제품 워크플로우를 위해 Capacitor 플러그인들에 의해 Capgo Capacitor 플러그인들에 의해 Capgo의 구현 세부 사항을 위해 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트의 구현 세부 사항을 위해 아이오닉 엔터프라이즈 플러그인 대체 아이오닉 엔터프라이즈 플러그인 대체의 제품 워크플로우를 위해, 그리고 Capgo 네이티브 빌드 Capgo 네이티브 빌드의 제품 워크플로우를 위해