3.1.0 • Published 3 months ago

vue3-picture-input v3.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Vue3-picture-input

This is a simple input for image

screen screen

WebSite

Migrate docs from 2 to 3 version

Docs for this version with examples

We need your ideas for new updates

If you any idea for update. Please, click here and fill in this form.

What's new?

  1. Properties paddingY and paddingX were added

Installation

NPM: npm i vue3-picture-input

YARN: yarn add vue3-picture-input

Getting starting

Usage

Import the package into your component. And you will get your first program with this component.

// src/App.vue
<template>
  <VueImageInput
    size="size-72"
    mimes=".png,.jpg"
    title="Drop file here"/>
  <button>Show</button>
</template>

<script>
import { VueImageInput } from 'vue3-picture-input'
import "vue3-picture-input/style.css"

export default {
  name: 'App',

  components: {
    VueImageInput,
  },
}
</script>

<style scoped></style>

In this code you have imported your component and have added his styles.

If you want to get your putted image as file use v-model:file:

In this code implemented getting putted file functionality.

<template>
  <VueImageInput
    size="size-72"
    mimes=".png,.jpg"
    title="Drop file here"/>
  <button @click="showFile">Show</button>
</template>

<script>
import VueImageInput from './components/VueImageInput.vue'

export default {
  name: 'App',

  data() {
    return {
      file: []
    }
  },

  methods: {
    showFile() {
      console.log(this.file)
    },
  },

  components: {
    VueImageInput,
  },
}
</script>

<style scoped></style>

Properties

size

Size of this component

params

paramvalue
size-41rem
size-82rem
size-123rem
size-164rem
size-205rem
size-246rem
size-287rem
size-328rem
size-369rem
size-4010rem
size-4411rem
size-4812rem
size-5213rem
size-5614rem
size-6015rem
size-6416rem
size-6817rem
size-7218rem
size-7619rem

background

Background inside this component.

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  background="#7a7a7a"/>

textColor

Text color for title

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  textColor="#7a7a7a"
  title="Drop file here"/>

border

Border params: border-style, border-width,

params

paramvalue
border-noneborder: none
borderborder-width: 1px
border-2border-width: 2px
border-3border-width: 3px
border-4border-width: 4px
border-5border-width: 5px
border-6border-width: 6px
border-7border-width: 7px
border-8border-width: 8px
border-9border-width: 9px
border-10border-width: 10px
border-solidborder-style: solid
border-dashedborder-style: dashed
border-dottedborder-style: dotted
border-doubleborder-style: double

borderColor

Border color

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  borderColor="#000"/>

bgRounded

Round background of this component.

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  bgRounded="50%"/>

imageRounded

Thank this prop you can round an image

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  bgRounded="50%"/>

closeBtn

Styles for closeBtn

params

When :hover

paramvalue
hover-opacity-10opacity: 10%
hover-opacity-20opacity: 20%
hover-opacity-30opacity: 30%
hover-opacity-40opacity: 40%
hover-opacity-50opacity: 50%
hover-opacity-60opacity: 60%
hover-opacity-70opacity: 70%
hover-opacity-80opacity: 80%
hover-opacity-90opacity: 90%
hover-opacity-100opacity: 100%

closeBtnColor

Color for close button

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  closeBtnColor="blue"/>

mimes

Accepted types of files

recomended '.png,.jpg'

title

This is a text at your component

fontSize

Font size of your title

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  fontSize="16px"/>

padding

Padding of the container component

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  padding="16px"/>

paddingX

Padding left and right of the container component

paddingY

Padding top and bottom of the container component

paddingLeft

Padding left of the container component

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  paddingLeft="16px"/>

paddingRight

Padding right of the container component

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  paddingRight="16px"/>

paddingTop

Padding top of the container component

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  paddingTop="16px"/>

paddingBottom

Padding bottom of the container component

Example usage:

<VueImageInput
  size="size-72"
  mimes=".png,.jpg"
  paddingBottom="16px"/>

Customize styles

If you want customize styles or add your own styles.

You need to make next:

  1. Delete styles of component.
// import "vue3-picture-input-test/style.css"
  1. Add your own slyles.
import 'url of your styles'

Or you can write styles in your style tag in your component.

<style scoped>
  /* Example styles */

  .border-11 {
    border-width: 11px;
  }
</style>
3.1.0

3 months ago

3.0.0

4 months ago

2.4.1

5 months ago

2.4.0

5 months ago

2.3.1

7 months ago

2.3.0

7 months ago

2.2.0

8 months ago

2.1.7

8 months ago

2.1.6

8 months ago

2.1.4

8 months ago

2.1.3

8 months ago

1.3.1

8 months ago

2.0.0

8 months ago

1.3.0

8 months ago

1.2.0

9 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago