Giter Club home page Giter Club logo

v-image's Introduction

V-Image ๐Ÿ“ท ยท github release npm version Build Status npm downloads

  • This is on GitHub so let me know if I've b0rked it somewhere, give me a star โญ if you like it ๐Ÿป
  • Demo here -> v-image

โœ… Install ๐Ÿ‘Œ

npm i v-image
// or 
yarn add v-image

โœ… Usage ๐ŸŽ“

Register the component globally:

Vue.component('vImage', require('v-image'));

Or use locally

import vImage from 'v-image';

โœ… Example ๐Ÿ€

  <v-image alt="Alt Text for the Image" name="name" @load-image="localVariable" :add-label="'My Custom Label'" :remove-label="'My Custom Remove Label'"></v-image>
import vImage from 'v-image';
export default {
  components: { vImage },
  methods: {
    localVariable(imageSentFromComponent) {
      this.image = imageSentFromComponent;
    },
  },
  data() {
    return {
      image: '',
      style: {
        height: '200px',
        width: '200px',
      },
    };
  },
};

โœ… ๐Ÿ“– Props:

Name Type Required? Default Description
name String Yes -- For name attribute for the input field.
alt String No Very Interesting Image For alt attribute for the input field, mostly for proper SEO.
imgStyle Object No -- Styling for the img tag.
add-label String No Select Image Label text shown to user where he clicks and select image popup is shown.
buttonStyle Object No -- Styling for the button & label tag.
remove-label String No Remove Image Button text shown to user where he clicks and image data is cleared.

โœ… ๐Ÿ‘‚ Events:

  • load-image (load the base64 to your custom component's variable (see example)) [default: ""]

NPM :octocat:

NPM

v-image's People

Watchers

James Cloos avatar andreas avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.