### Handle E-IMZO Installation and Errors Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/README.md Provides an example of handling E-IMZO installation and potential errors using the `useESignature` composable. It checks the success of the installation and then conditionally displays prompts for installing E-IMZO or updating it based on specific error messages. Errors are cleared after handling. ```typescript const { install, error, clearError } = useESignature() const success = await install() if (!success) { if (error.value?.includes('E-IMZO')) { // E-IMZO not installed showInstallPrompt() } else if (error.value?.includes('version')) { // Version too old showUpdatePrompt() } clearError() } ``` -------------------------------- ### TypeScript Configuration Example Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/guide/installation.md Ensure your `tsconfig.json` includes necessary compiler options for optimal TypeScript integration with Vue E-Signature. This includes module resolution and strict type checking. ```json { "compilerOptions": { "moduleResolution": "bundler", "strict": true } } ``` -------------------------------- ### Initialize E-IMZO Service Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/guide/quick-start.md Initializes the E-IMZO service when the component is mounted. It sets the loading state, calls the `install` function, and fetches available certificates using `listKeys`. Error handling is included to log any initialization failures. This function relies on the `useESignature` composable. ```vue ``` -------------------------------- ### Initialize E-IMZO and Handle Installation Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/api/composable.md Demonstrates how to initialize the E-IMZO service using the 'install' method and subsequently check the installation status and any errors. This is crucial for ensuring the digital signature environment is ready before proceeding with other operations. ```typescript const { install, isInstalled, error } = useESignature() await install() if (error.value) { console.error('Failed:', error.value.message) } else { console.log('Installed:', isInstalled.value) } ``` -------------------------------- ### Install Vue E-Signature Package Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/guide/installation.md Install the Vue E-Signature package using your preferred package manager. This is the initial step to include the library in your project. ```bash npm install @sanjarbarakayev/vue-esignature ``` ```bash pnpm add @sanjarbarakayev/vue-esignature ``` ```bash yarn add @sanjarbarakayev/vue-esignature ``` -------------------------------- ### Example: Initialize EIMZOMobile Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/api/e-imzo-mobile.md Provides a practical example of initializing the EIMZOMobile class with a specific site ID, an HTML element, the 'qrcode.js' library, and custom dimensions. ```typescript import QRCode from 'qrcode.js' const element = document.getElementById('qrcode')! const mobile = new EIMZOMobile('SITE123', element, QRCode, { width: 256, height: 256 }) ``` -------------------------------- ### Install qrcode.js Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/api/e-imzo-mobile.md Provides the npm command to install the 'qrcode.js' library, a compatible QR code generation library. ```bash npm install qrcode.js ``` -------------------------------- ### Start Playground Development Server (Bash) Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/playground/README.md Commands to start the interactive development environment for vue-esignature. This utilizes pnpm for package management and enables hot module replacement for rapid development. ```bash pnpm playground # Or from this directory pnpm dev ``` -------------------------------- ### Complete Vue Component Example Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/api/e-imzo-mobile.md A full Vue 3 component using the Composition API that integrates EIMZOMobile for generating and displaying QR codes. It includes setup, mounting, unmounting, and regeneration logic. ```vue ``` -------------------------------- ### Complete Vue Component for E-Signature Source: https://github.com/sanjarbarakayev/vue-esignature/blob/main/docs/guide/quick-start.md A comprehensive Vue 3 component that utilizes the useESignature composable to handle digital signing. It includes UI elements for certificate selection, document input, and displaying the generated signature. It also manages loading states and error handling, and provides a fallback to download the E-IMZO application if it's not installed. ```vue