This is a component for picture uploaded by base64
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
"webpack": "^2.6.1",
"vue": "^2.3.3"
<template>
<div class="demo">
<PictureUpload v-on:imgInfo = 'getInfo'></PictureUpload>
</div>
</template>
<script>
import PictureUpload from 'picture-upload'
import Css from 'picture-upload/dist/picture-upload.min.css'
export default {
name: 'demo',
data () {
return {
}
},
components:{
PictureUpload
},
methods:{
getInfo(imgInfo){
console.log(imgInfo)
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
'format': format, //转化后的格式
'base' : base, //转化后的base码
'fullInfo': fullInfo //全部信息
For detailed explanation on how things work, checkout the guide and docs for vue-loader.