<template>
	<view @click="onClick">
		<slot></slot>
	</view>
</template>

<script>
	import { chooseFile } from '@/uni_modules/lime-choose-file'
	export default {
		props: {
			disabled: Boolean	
		},
		emits: ['success', 'fail'],
		data() {
			return {
				images: []
			}
		},
		methods: {
			onClick() {
				if(this.disabled) return
				chooseFile({
					success:(res)=>{
						this.$emit('success', res)
					},
					fail(err){
						this.$emit('fail', err)
					}
				})
			}
		}
	}
	
</script>

<style>

</style>