Skip to content

pollux2015/vue-camera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-camera

vue-camera,一个自己写的vue插件,getusermedia调用摄像头拍照与生成canvas, 毕设做完会继续填坑~~

演示(demo)

demo

Install

npm install vue-camera

How to use

组件调用

<template>
  <div>
    <Camera/>
  </div>
</template>

import camera from 'vue-camera'
export default {
  name: 'app',
  components: {
    Camera
  }
}

Props

props: {
  ow: {
    type: [Number, String],
    default: 400
  },
  oh: {
    type: [Number, String],
    default: 300
  },
  fillColor: {
    type: String,
    default: '#000'
  },
  placement: {
    type: String,
    default: '请点击打开摄像头'
  },
  maxView: {
    type: Number,
    default: 10
  }
}

$emit

this.$emit('error', err); // 错误
this.$emit('tocanvas', dataUrl) // 拍照生成canvas

About

getusermedia调用摄像头拍照与生成canvas

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published