<template>
	<view id="l-camera">
		<text>web 不支持</text>
	</view>
</template>

<script>
	export default {
		name: "l-camera",
		emits: ['stop', 'error', 'initdone','ready','scancode'],
		props: {
			"mode": {
				type: String,
				default: "normal"
			},
			"resolution": {
				type: String,
				default: "medium" // low | high
			},
			"devicePosition": {
				type: String,
				default: "back" // front前置 |back 后置
			},
			"flash": {
				type: String,
				default: "auto" // auto, on, off, torch
			},
			"frameSize": {
				type: String,
				default: "medium" // small|large
			}
		},
		data() {
			return {
				
			}
		},
		watch: {
			"devicePosition": {
				/**
				 * 这里监听属性变化，并进行组件内部更新
				 */
				handler(newValue : string, oldValue : string) {
					if(oldValue == newValue) return
					// this.$el?.switchCamera(newValue)
				},
				immediate: false // 创建时是否通过此方法更新属性，默认值为false
			},
			"flash": {
				/**
					 * 这里监听属性变化，并进行组件内部更新
					 */
				handler(newValue : string, oldValue : string) {
					if(oldValue == newValue) return
					// this.$el?.setFlash(newValue)
				},
				immediate: false // 创建时是否通过此方法更新属性，默认值为false
			
			}
		},
		methods: {
			init(){
				return '11'
			}
		}
	}
</script>

<style>

</style>