Nuxt.js

Installation

You can install Cortado.js via npm:


npm install cortado-js

Usage

Nuxt.js applications can greatly benefit from Cortado.js's image optimization and resizing capabilities. By using the optimizeImage and resizeImage functions, you can efficiently manage image sizes and improve load times. Here's how to use both methods in your Nuxt.js project:


// Import optimizeImage and resizeImage functions from Cortado.js
import { optimizeImage, resizeImage } from 'cortado-js';

export default {
  methods: {
    async loadImages() {
      // Call optimizeImage with the path to your image
      const optimizedImage = await optimizeImage('image.jpg');
      // Use the optimized image source in your component
      this.optimizedImageSrc = optimizedImage;
      
      // Call resizeImage to resize the image to a specific width and height
      const resizedImage = await resizeImage('image.jpg', { width: 300, height: 200 });
      // Use the resized image source in your component
      this.resizedImageSrc = resizedImage;
    },
  },
};

Cortado.js seamlessly integrates into your Nuxt.js workflow, providing both image optimization and resizing capabilities to enhance your application's performance.

© 2024 Cortado. All rights reserved.

Designed by Ditych. Powered by Framer.

© 2024 Cortado. All rights reserved.

Designed by Ditych. Powered by Framer.