1.0.4 • Published 4 years ago

photos-editor v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

photos-editor

基于vue 2.x 的图片编辑合成组件

Photo editing and composition component based on Vue 2.x

demo

Project setup

npm install photos-editor --save

Import photos-editor

In main.js:

import photosEditor from 'photos-editor'

Vue.use(photosEditor)

Example

<!-- template -->
<Photos-editor @stateChange="getState" :imgData="imgInfo" :bgData="bgImg" :btnImg="btnUrl"></Photos-editor>
<div @click="joinImg">join</div>

<script>
export default {
  data() {
    return {
      bgImg: require('Image path'),
      imgInfo: {
        img: ''
      },
      btnUrl: require('Image path')
    }
  },
  methods: {
    getState(resqult) {
      if (resqult.state === 'start') {
        console.log('Start generating pictures')
      }
      if (resqult.state === 'finish') {
        console.log('Generation end')
        console.log(resqult.url)
      }
    },
    joinImg() {
      this.imgInfo.img = require('Image path')
    }
  }
}
</script>

Attribute

AttributeDescriptionType
imgDataInserted imageobject
bgDataBackground pictureString
btnUrlbutton imageString

Events

eventsDescriptionReturn Value
stateChangeresult state and urlresqult.state/resqult.url
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago