🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@mathewparet/vue-crop-tool

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathewparet/vue-crop-tool

A tool to easily crop input image. Works like a normal input.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

@mathewparet/vue-crop-tool

A tool to easily crop input image. Works like a normal input.

Build Setup

# install dependencies
npm install

# build for production with minification
npm run build

Global Import

import CropperBox from '@mathewparet/vue-crop-tool';
Vue.use(CropperBox);

Usage Example

<div class="form-group row">
    <label for="avatar" class="col-md-4 col-form-label text-md-right">Avatar</label>
    <div class="col-md-6">
        <crop-tool name="avatar" preview="avatar-preview" canvas="avatar-crop-space" v-model="form.avatar">
            <span class="form-text text-muted">
                Required only if you wish to change current profile picture.
            </span>
        </crop-tool>
        <img src="" id="avatar-crop-space" width="100" />
    </div>
</div>
<div>
    <div class="avatar-preview rounded-circle" id="profile-pic" style="overflow: hidden; width: 140px; height: 140px; background: url('//via.placeholder.com/140x140/ffffff/?text=Preview')"></div>
</div>

Attributes

NameDescriptionRequired?
previewThe class name of the <div> element within which the preview will be shown.Yes
canvasThe DOM ID of the <img> element that use used as the crop spaceYes

Notes

  • To limit the crop size, set the width and height of the preview <div>.
  • The cropped value will be returned in the v-model.
  • v-model can't be used to set the initial value.

FAQs

Package last updated on 24 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts