An open API service indexing awesome lists of open source software.

https://github.com/isystk/vue-image-base64

画像ファイルをBase64に変換するVue.js用コンポーネントです
https://github.com/isystk/vue-image-base64

Last synced: 3 months ago
JSON representation

画像ファイルをBase64に変換するVue.js用コンポーネントです

Awesome Lists containing this project

README

        

# vue-image-base64

画像ファイルをBase64に変換するVue.js用コンポーネントです

# DEMO

https://isystk.github.io/vue-image-base64

# Features

- ファイルを選択するとBase64に変換されたデータをJSON形式で返却します。
- 画像のサイズを指定することでリサイズすることが可能です。
- HEIC形式の画像の場合はJPEGに変換します。
- ドラッグ&ドロップでアップロードファイルの選択が可能です。

# Requirement

* heic2any 0.0.3

# Installation

```bash
yarn add -D vuejs-image-base64
```

# Usage

```bash
git clone https://github.com/isystk/vue-image-base64.git
cd vue-image-base64
# 開発用に起動する
yarn serve
# GitHubPageに公開
yarn build
yarn deploy-demo
# npmに公開する
yarn build-bundle
npm login
npm publish
```

# Note

```

import VueImageBase64 from 'vuejs-image-base64'
import {reactive} from "vue";

const store = reactive({
images: {data: []},
errors: []
})

const handleChange = function(data) {
if (data.result) {
let list =store.images.data
list.push(data);
store.images = {data: list}
} else {
store.errors = data.messages;
}
}

```

# Author

[isystk](https://github.com/isystk)

# License

[MIT](https://en.wikipedia.org/wiki/MIT_License).