Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/react-upload-weibo
Weibo upload pictures for react.
https://github.com/afeiship/react-upload-weibo
react upload weibo
Last synced: 22 days ago
JSON representation
Weibo upload pictures for react.
- Host: GitHub
- URL: https://github.com/afeiship/react-upload-weibo
- Owner: afeiship
- License: mit
- Created: 2018-08-31T16:27:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T06:37:48.000Z (almost 4 years ago)
- Last Synced: 2024-10-26T22:54:06.121Z (2 months ago)
- Topics: react, upload, weibo
- Language: JavaScript
- Size: 159 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# react-upload-weibo
> Weibo upload pictures for react.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install -S @jswork/react-upload-weibo
```## properties
| Name | Type | Required | Default | Description |
| --------- | ------ | -------- | ------- | ------------------------------------- |
| className | string | false | - | The extended className for component. |
| onChange | func | false | noop | The change handler. |
| limit | number | false | 10 | The max upload limit. |
| token | string | false | - | The weibo oss token. |## usage
1. import css
```scss
@import "~@jswork/react-upload-weibo/dist/style.css";// or use sass
@import "~@jswork/react-upload-weibo/dist/style.scss";// customize your styles:
$react-upload-weibo-options: ()
```
2. import js
```js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactUploadWeibo from '@jswork/react-upload-weibo';
import './assets/style.scss';class App extends React.Component {
state = {
items: [],
token:
'SUB=_2A25NRDndDeRhGeVI7VMZ8yzEyz-IHXVuMCwVrDV_PUNbm9AfLVX9kW9NTBpP0WiKCSBlMw7oSMG7Zy0nrMofP6ea'
};handleChange = (e) => {
console.log(e.target.value);
this.setState({ items: e.target.value });
};handleTokenChange = (e) => {
console.log('token changed.');
};render() {
const { items } = this.state;return (
{items.map((item) => {
return ;
})}
);
}
}ReactDOM.render(, document.getElementById('app'));
```
## documentation
- https://afeiship.github.io/react-upload-weibo/## license
Code released under [the MIT license](https://github.com/afeiship/react-upload-weibo/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/react-upload-weibo
[version-url]: https://npmjs.org/package/@jswork/react-upload-weibo[license-image]: https://img.shields.io/npm/l/@jswork/react-upload-weibo
[license-url]: https://github.com/afeiship/react-upload-weibo/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-upload-weibo
[size-url]: https://github.com/afeiship/react-upload-weibo/blob/master/dist/react-upload-weibo.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/react-upload-weibo
[download-url]: https://www.npmjs.com/package/@jswork/react-upload-weibo