1.0.12 • Published 3 years ago

xpf-img v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

xpf-img

A Vue.js project

Build Setup

# install package
npm i xpf-img --save

# install element-ui
npm i element-ui -S

# import package
import XpfImg from 'xpf-img'

# use it,you need to use choiceImg
<XpfImg @choiceImg="xxx"></XpfImg>

demo

<template>
  <div id="app">
    <XpfImg @choiceImg="uploadImg"></XpfImg>
  </div>
</template>

<script>
import XpfImg from 'xpf-img'
import axios from 'axios'
export default {
  components: {
    XpfImg
  },
  methods: {
    uploadImg (data) {
      let formData = new FormData();
      formData.append('files', data, "DX.jpg")
      axios({
        method: "post",
        url: 'http://xxx/upload/remote',
        data: formData,
        headers: {
          'Content-Type': 'multipart/form-data'
        }
      }).then((res) => {
        console.log(res);
      })
    }
  }
}
</script>
1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago