1.0.2 • Published 5 years ago
o-s-upload v1.0.2
Install
npm install --save o-s-upload
Useage
use in the vue component
<template>
<div>
<o-s-upload
:ossDir="ossDir"
:getSgin="getSgin"
:dom="logo"
ref="logo"
></z-o-upload>
</div>
</template>
<script>
import OSUpload from 'o-s-upload'
export default {
name: 'Test',
data () {
return {
ossDir: 'myDir',
getSgin: 'http://xxx.xxx.com/get_sgin',
logo: 'logo',
logoSrc: ''
}
},
methods: {
getUrl () {
this.logoSrc = this.$refs.logo.imgUrl
},
setUrl () {
this.$refs.logo.imgUrl = 'https://www.baidu.com/img/baidu_jgylogo3.gif'
}
}
}
</script>
<style></style>
Component props
propos | type | default value | explain |
---|---|---|---|
dom | String | '' | required field |
ossDir | String | '' | required field |
getSgin | String | '' | required field |
addIcon | String | 'upload.png' | |
loadding | String | 'loadding.gif' | |
boxStyle | Object | {} | |
height | Number | 0 | image height(px, no limit) |
width | Number | 0 | image width(px, no limit) |
customName | String | '' | System naming |
ratio | Number | 0.75 | Compression ratio |
License
copyright © 2019 zhaizhaohui