Git Product home page Git Product logo

magic-upload-image's Introduction

magic-upload-image

基于Vue.js 1.0 模拟Github issues 的图片上传组件

支持图片上传方式

  • 截图黏贴上传
  • 拖拽上传
  • 选择图片

Demo地址: demo

demo

实现方式

浏览器

  • 截图黏贴上传使用 paste 事件, 浏览器的支持度:caniuse paste
  • 拖拽上传 drop drag 事件
  • 选择图片 from 表单 change 事件

服务端 node

  • dev-upload.js 基于 express 写的开发用的图片上传服务,图片保存在本地,启动方式 npm run dev
  • koa-es6-server.js 基于 koa es6 写的图片上传服务,图片保存在本地, 启动方式 npm run koa
  • lean-server.js 基于 express 写的 leancloud node服务器,图片上传后保存在leancloud leancloud-code 文档

开发

# install dependencies
npm install

# serve with hot reload at localhost:3002
npm run dev

# build for production with minification
npm run build

# run koa server
npm run koa

发布到leancloud

# 安装lean工具
npm install -g leancloud-code

npm run build

lean add <app> <app-id>

# 发布测试
lean deploy

# 发布正式
lean publish

magic-upload-image's People

Contributors

xiaokaike avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.